The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2013-04-17 14:48:51

jasonrohrer
Administrator
Registered: 2013-04-01
Posts: 1,235

Server timeout issues fixed

As load on the server has changed over time, and particularly with the introduction of real locks in the database (which can correctly cause some client requests to wait until other requests finish first), combined with general network flakiness, client timeouts have become a bigger issue.

The client waits 16 seconds before retrying a request.  If the first request never made it to the server (network outage), this works great:  the second request goes through, and the client's operation happens (for example, starting the robbery of a house).

However, if the client's first request actually DID go through (but maybe the server was really slow that moment, or maybe the response was lost in the network), then we have a problem.  Suddenly, the client is trying to check out a house for robbery that is already checked out (checked out by the client itself), or trying to buy a painting that has already been bought.

The server code was not expecting this to happen, so it was very strict about this.  Sometimes, double requests like this would even end up killing a player (through no fault on that player's part) and giving them a fresh start.  In other cases, there was no obvious way for the server to react to a double-request beside failure (you can't end a robbery twice, when the second end would require transferring loot that is no longer there).

In cases where double requests are clearly harmless, I've loosened up the server.  In other cases, I'm essentially logging the last server response to "replay" it to the client in case of what seems like a double-request.  If you're trying to end a robbery that the server thinks has already been ended, then it won't transfer the loot a second time, but it will tell your client how much loot was transfered last time (so the client, unaware that the first request actually went through, can display a correct robbery result to the player).

Most of this has been fixed now, to the point where you should NEVER be killed by the server because of a request retry.  Keep an eye out for that red [!] icon in the upper-right corner, though.  That means a retry has been sent.  If you see any more strange server behavior related to retries, please let me know by email (with last recordedGame and stdout.txt if you have it).

(Also, you may still see a failure message if ending a robbery times out, but it shouldn't kill you.  I'm working on fixing even that failure message.)

Offline

Board footer

Powered by FluxBB 1.5.8