{"action":"created","issue":{"url":"https://api.github.com/repos/BanManagement/BanManager/issues/295","labels_url":"https://api.github.com/repos/BanManagement/BanManager/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/BanManagement/BanManager/issues/295/comments","events_url":"https://api.github.com/repos/BanManagement/BanManager/issues/295/events","html_url":"https://github.com/BanManagement/BanManager/issues/295","id":83424375,"number":295,"title":"FEATURE: safe mode for offline database","user":{"login":"robrobk","id":5210502,"avatar_url":"https://avatars.githubusercontent.com/u/5210502?v=3","gravatar_id":"","url":"https://api.github.com/users/robrobk","html_url":"https://github.com/robrobk","followers_url":"https://api.github.com/users/robrobk/followers","following_url":"https://api.github.com/users/robrobk/following{/other_user}","gists_url":"https://api.github.com/users/robrobk/gists{/gist_id}","starred_url":"https://api.github.com/users/robrobk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robrobk/subscriptions","organizations_url":"https://api.github.com/users/robrobk/orgs","repos_url":"https://api.github.com/users/robrobk/repos","events_url":"https://api.github.com/users/robrobk/events{/privacy}","received_events_url":"https://api.github.com/users/robrobk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-01T10:25:39Z","updated_at":"2015-06-02T11:17:02Z","closed_at":null,"body":"hi\r\nwe have a network, \r\none server is hosted on the same machine as the mysql database, but the rest of the network is on a separate machine.\r\nwhen the machine with the mysql db goes offline, banmanager is disabled on all the servers except the one on the same machine\r\nall the commands break until a server restart.\r\n\r\nmy suggestion is this:\r\ninstead of disabling the plugin, put it into a \"safe mode\" where every 5 minutes, it re tries to connect to the database,\r\nwhile its in the safe mode, have basic local support for /ban and /ipban (just the important ones, dont need the rest while in safe mode) so we can still use those commands.\r\nwhen someone tries any command, tell them that it is in safe mode, and it will try soon,\r\n\r\nonce it succeeds in connecting to the database, it comes out of the safe mode, enables full support for all commands, and starts working normally\r\n\r\n\r\nEDIT: basically i want it to try to connect to the database again, instead of shutting itself down"},"comment":{"url":"https://api.github.com/repos/BanManagement/BanManager/issues/comments/107918294","html_url":"https://github.com/BanManagement/BanManager/issues/295#issuecomment-107918294","issue_url":"https://api.github.com/repos/BanManagement/BanManager/issues/295","id":107918294,"user":{"login":"confuser","id":1658997,"avatar_url":"https://avatars.githubusercontent.com/u/1658997?v=3","gravatar_id":"","url":"https://api.github.com/users/confuser","html_url":"https://github.com/confuser","followers_url":"https://api.github.com/users/confuser/followers","following_url":"https://api.github.com/users/confuser/following{/other_user}","gists_url":"https://api.github.com/users/confuser/gists{/gist_id}","starred_url":"https://api.github.com/users/confuser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confuser/subscriptions","organizations_url":"https://api.github.com/users/confuser/orgs","repos_url":"https://api.github.com/users/confuser/repos","events_url":"https://api.github.com/users/confuser/events{/privacy}","received_events_url":"https://api.github.com/users/confuser/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T11:17:02Z","updated_at":"2015-06-02T11:17:02Z","body":"BanManager will attempt to reconnect whilst the minecraft instance is running. It will only disable itself if it cannot connect on startup, in which case is the correct thing to do, as that is when it builds its in-memory cache of bans etc. Without that, it'll fail to function.\r\n\r\nYour database server shutting down in production sounds incredibly bad. If that happens, then you should expect things to start failing, like BanManager.\r\n\r\nIn what scenarios would you ever need to shut down your database server in a production environment? The machine that hosts the Frostcast MySQL database has been online for more than 370 days now, without any incidents. If your database goes down often, I would recommend you speak with your host.\r\n\r\nWhat you're asking for would be a lot of work, with very little benefit. Essentially you want BanManager to handle states where the connection is not available at start up, and to constantly attempt to connect to the database. During this time, banned players will be able to join. Whilst v4 and below used to use the vanilla banning system as a fallback, due to the UUID changes, that actually caused a lot of issues due to side effects added by the Bukkit team, so I removed it to avoid any future problems caused by it. I could implement a file based cache local to each server, but then additional problems arise with that in terms of synchronisation. At that point, BM may as well not even use an SQL database, as it is gaining little to no benefits from one, as it'll become heavily I/O dependent (which is slow), except for passing data between servers without depending on a proxy like bungee or lilypad."}}