Skip to content

Conversation

@ClaudiuHKS
Copy link
Contributor

Fix SQL modules threading because of the problem(s) listed below.

  • 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 ...
  • 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.

What can I say about my changes?

  • Changing the SleepTime (milliseconds) from 250...500 to 25, because SourceMod uses the same (they even use 20 milliseconds).
  • Reducing the interval of SQL Threaded Queries check in StartFrame() Meta Mod Forward.
  • 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.
  • Also, making sure that everything is going to be executed, even with Internet connection or without.
  • Changed WinSock to WinSock2 in MySQL module.

Did I test that?

You 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.
http://pastebin.com/UZmVhpQA

You can see that even spamming, everything is going to be executed safe.

@ClaudiuHKS ClaudiuHKS closed this Feb 17, 2015
@ClaudiuHKS ClaudiuHKS deleted the MySQLThreadingFix branch February 17, 2015 15:47
@ClaudiuHKS ClaudiuHKS restored the MySQLThreadingFix branch February 17, 2015 15:48
@ClaudiuHKS ClaudiuHKS deleted the MySQLThreadingFix branch February 17, 2015 15:48
@ClaudiuHKS ClaudiuHKS restored the MySQLThreadingFix branch February 17, 2015 15:49
@ClaudiuHKS ClaudiuHKS reopened this Feb 17, 2015
@dvander
Copy link
Member

dvander commented Feb 17, 2015

In the future these should all be separate PRs as they are separate issues.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: fix identation here, and in the other extension like it.

@Arkshine
Copy link
Member

Looks fine. Will ask people on forum to test it to confirm it helps.

🚢

Arkshine added a commit that referenced this pull request Feb 18, 2015
@Arkshine Arkshine merged commit 2b9e9c7 into alliedmodders:master Feb 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants