Premium Accounts
Get extra features and no ads!

Server crashes

By: Adam Plumb 15.6 years ago
In the spirit of keeping people up on current events, I've been battling with the server to not crash every day or so like it has been. Up until this morning, I had no idea what it could have been, but the last time I restarted the game server I ran it in a debugger called gdb. With the debugger running, now when the server crashes I can see in the code roughly where the crash originated.

Since the server crashed last night, I was able to find the culprit: python's _mysql module. Not that the module itself was to blame, no, it was more my ignorance. Apparently, a mysql connection cannot be used between threads, which is something I'm pretty sure I was doing. The result is that I've made some changes that should make the mysql calls thread safe (I hope). I'm pretty new to threaded python programming, so there will probably be a few more bumps along the way, but things will eventually get better.