{"action":"created","issue":{"url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/207","labels_url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/207/comments","events_url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/207/events","html_url":"https://github.com/alliedmodders/amxmodx/pull/207","id":57929257,"number":207,"title":"Fix SQL Modules Threading","user":{"login":"ClaudiuHKS","id":9334579,"avatar_url":"https://avatars.githubusercontent.com/u/9334579?v=3","gravatar_id":"","url":"https://api.github.com/users/ClaudiuHKS","html_url":"https://github.com/ClaudiuHKS","followers_url":"https://api.github.com/users/ClaudiuHKS/followers","following_url":"https://api.github.com/users/ClaudiuHKS/following{/other_user}","gists_url":"https://api.github.com/users/ClaudiuHKS/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaudiuHKS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaudiuHKS/subscriptions","organizations_url":"https://api.github.com/users/ClaudiuHKS/orgs","repos_url":"https://api.github.com/users/ClaudiuHKS/repos","events_url":"https://api.github.com/users/ClaudiuHKS/events{/privacy}","received_events_url":"https://api.github.com/users/ClaudiuHKS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alliedmodders/amxmodx/labels/enhancement","name":"enhancement","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-17T14:20:15Z","updated_at":"2015-02-18T18:34:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alliedmodders/amxmodx/pulls/207","html_url":"https://github.com/alliedmodders/amxmodx/pull/207","diff_url":"https://github.com/alliedmodders/amxmodx/pull/207.diff","patch_url":"https://github.com/alliedmodders/amxmodx/pull/207.patch"},"body":"Fix SQL modules threading because of the problem(s) listed below.\r\n\r\n* The game server is having problems when too many threaded queries are started and the connection between the game server and the MySQL remote server is lost. Problems consist in 'queueTime' (Float) higher than 5.0 seconds, up to ...\r\n\r\n* The server is having problems when map changes (during OnPluginsUnloading() AMX Mod X Core Forward) if the connection is lost or too many threaded queries are started. It just freezes to execute all the remaining threaded queries, and some OS such Linux are killing processes that are frozen for 5-10-15 seconds, unfortunately.\r\n\r\nWhat can I say about my changes?\r\n\r\n* Changing the SleepTime (milliseconds) from 250...500 to 25, because SourceMod uses the same (they even use 20 milliseconds).\r\n* Reducing the interval of SQL Threaded Queries check in StartFrame() Meta Mod Forward.\r\n* Making sure so the BaseThreader executes much more threads when OnAmxxDetach and OnPluginsUnloading AMX Mod X Core Forwards are reached so everything is getting flushed amazingly fast when the map ends.\r\n* Also, making sure that everything is going to be executed, even with Internet connection or without.\r\n* Changed WinSock to WinSock2 in MySQL module.\r\n\r\nDid I test that?\r\n\r\nYou can see a SQL Stress Test plug-in I made for myself, I will not include that as a \"Test Suite\" because it's too abusive.\r\nhttp://pastebin.com/UZmVhpQA\r\n\r\nYou can see that even spamming, everything is going to be executed safe.\r\n"},"comment":{"url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/comments/74919931","html_url":"https://github.com/alliedmodders/amxmodx/pull/207#issuecomment-74919931","issue_url":"https://api.github.com/repos/alliedmodders/amxmodx/issues/207","id":74919931,"user":{"login":"Arkshine","id":360640,"avatar_url":"https://avatars.githubusercontent.com/u/360640?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkshine","html_url":"https://github.com/Arkshine","followers_url":"https://api.github.com/users/Arkshine/followers","following_url":"https://api.github.com/users/Arkshine/following{/other_user}","gists_url":"https://api.github.com/users/Arkshine/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkshine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkshine/subscriptions","organizations_url":"https://api.github.com/users/Arkshine/orgs","repos_url":"https://api.github.com/users/Arkshine/repos","events_url":"https://api.github.com/users/Arkshine/events{/privacy}","received_events_url":"https://api.github.com/users/Arkshine/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T18:34:02Z","updated_at":"2015-02-18T18:34:02Z","body":"Looks fine. Will ask people on forum to test it to confirm it helps.\r\n\r\n:ship: "}}