Server Stability
Posted: Wed Dec 05, 2012 12:24 pm
So I think I finally verified what causes the freezes and fixed the problem.
It looks like when a users connection timed out in a weird way due to a connection problem (like a router reset) and not just a normal client crash you could get a case where the user could login a second time and be duplicated. If the new user played a song while the duplicated user is still on the server it caused the freeze. A couple people helped me verify this last night.
I changed the server code so now when you login it checks to see if your already logged in and will kick your original connection (disconnecting the user) when you login the second time which should prevent this situation from coming up.
Also the other major bug starting a song when a player lacks or right when a player joins it causes everyone to hang I think that bug is taken care of to. I implemented a bunch of the newer code from Angelo's OpenSMO that fixed this. Before running all the code changes caused the server to be crashy but it seems ok with just the change for fixing this bug. If it does crash unlike before we have the ability to easily trace what line it is crashing on and thus can be troubleshooted pretty easily (much easier than these freezes that don't give us debugging output).
I tested quite a few cases (even a hung client) and in the case where a lacker would cause a problem their client just doesnt start playing (everyone else does) and they have to wait for the next song. Or if a person spam selects and everyone lacks then only that person will start and the others wont without hanging.
As of 10 minutes ago the server is running this new version which I hope will prove to be much more stable.
It looks like when a users connection timed out in a weird way due to a connection problem (like a router reset) and not just a normal client crash you could get a case where the user could login a second time and be duplicated. If the new user played a song while the duplicated user is still on the server it caused the freeze. A couple people helped me verify this last night.
I changed the server code so now when you login it checks to see if your already logged in and will kick your original connection (disconnecting the user) when you login the second time which should prevent this situation from coming up.
Also the other major bug starting a song when a player lacks or right when a player joins it causes everyone to hang I think that bug is taken care of to. I implemented a bunch of the newer code from Angelo's OpenSMO that fixed this. Before running all the code changes caused the server to be crashy but it seems ok with just the change for fixing this bug. If it does crash unlike before we have the ability to easily trace what line it is crashing on and thus can be troubleshooted pretty easily (much easier than these freezes that don't give us debugging output).
I tested quite a few cases (even a hung client) and in the case where a lacker would cause a problem their client just doesnt start playing (everyone else does) and they have to wait for the next song. Or if a person spam selects and everyone lacks then only that person will start and the others wont without hanging.
As of 10 minutes ago the server is running this new version which I hope will prove to be much more stable.