Bug 2784 - CL_GetServerCommand: a reliable command was cycled out
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Tim Angus
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2006-07-17 17:21 EDT by Tony J. White
Modified: 2007-05-21 11:23:13 EDT
0 users

See Also:


Attachments
fix cmd overflow caused by slow loading (486 bytes, patch)
2006-07-18 17:20 EDT, Tony J. White
svn913 no configstring updates while CS_PRIMED (4.32 KB, patch)
2006-09-22 12:34 EDT, Tony J. White
svn913 no server commands while CS_PRIMED (740 bytes, patch)
2006-09-22 12:34 EDT, Tony J. White
svn913 no configstring updates while CS_PRIMED (4.28 KB, patch)
2006-09-22 19:36 EDT, Tony J. White
svn917 no configstring updates until CS_ACTIVE (5.33 KB, patch)
2006-10-09 17:29 EDT, Tony J. White

Description Tony J. White 2006-07-17 17:21:46 EDT
Players with slow computers tend to get this message when starting a new map on a server with lots of players.

This is caused by the flood of server commands that the client recieves between ClientConnect() and ClientBegin().

I'm not sure what the proper fix is at this time, but I've been meaning to look into it.
Comment 1 Tony J. White 2006-07-18 17:15:23 EDT
Moving to ioquake3 since it looks like it's an engine fix.
Comment 2 Tony J. White 2006-07-18 17:20:06 EDT
Created attachment 965 [details]
fix cmd overflow caused by slow loading

There doesn't seem to be any good reason to send server cmd's to the client when it is connected but has not yet recieved the gamestate.  On servers with many players it's bound to overflow the MAX_RELIABLE_COMMANDS (128) especially when a level first starts and the server spams out commands for every "connected" and "entered the game" message.
Comment 3 Tony J. White 2006-07-18 17:22:44 EDT
I should also mention that it appears Enemy Territory has the same behaviour since I don't see any chat messages in the console that were sent out while I was still loading (this was not the case in Tremulous before this patch).
Comment 4 Tony J. White 2006-09-22 12:31:56 EDT
Although my first patch was valid, it didn't really solve the problem.  Here is what really happens:

A connecting client goes from CS_CONNECTING to CS_PRIMED when the server sends them the gamestate.  This is right BEFORE the client starts loading the map.  The server continues to try to push server commands at the client as long as they are CS_PRIMED even though the client is too busy to handle the incoming requests.

In Tremulous this behaviour is especially brutal since as players join the game, the CS_PLAYERS strings are updated like crazy at the start of the map as players join teams, pick classes, evolve, etc.  It seems like the largest offender here is the server commands that update configstrings.

My solution (first patch) attacks only the problem of configstring update commands:

  1) do not send any configstring update commands to the client until they are CS_ACTIVE

  2) keep a record of which configstrings have been updated when a client is CS_PRIMED

  3) when a client goes from CS_PRIMED to CS_ACTIVE send configstring update commands for each configstring that was updated while they were primed.

This takes care of the majority of real world senarios of this overflow problem, and will not cause any compatability issues.

However, this is not a complete solution.  The second patch (depends on the first patch) stops the sending of ALL COMMANDS until the client is CS_ACTIVE.  This has a potential to cause all kinds of problems, but since I couldn't think of anything offhand.   Whether or not this patch is valid depends on the following assumption:

  "Other than the configstring update commands, no other server commands should change a client's gamestate"

If this assumption is true, then this second patch is valid and should prevent this error from ever occuring because of long client load times.
Comment 5 Tony J. White 2006-09-22 12:34:26 EDT
Created attachment 1090 [details]
svn913 no configstring updates while CS_PRIMED
Comment 6 Tony J. White 2006-09-22 12:34:56 EDT
Created attachment 1091 [details]
svn913 no server commands while CS_PRIMED
Comment 7 Tony J. White 2006-09-22 19:36:57 EDT
Created attachment 1092 [details]
svn913 no configstring updates while CS_PRIMED

mistakenly neglected to update configstrings that had been changed to empty values
Comment 8 Tony J. White 2006-10-09 16:59:02 EDT
It looks like it will be too problematic if we don't send any server commands at all while CS_PRIMED (first patch).  There are a couple of things that would need to be changed in the q3a game code to make this work reliably (e.g. in-band 'disconnect' commands).  Since there are without a doubt many more potential problems in various other mods this would be a bad idea.

The 'no configstring updates while CS_PRIMED' patch is well tested by some Tremulous servers and it doesn't have much potential to cause problems.  It should be beneficial to all q3 games since it will often reduce load times even in cases where the reliable command buffer doesn't overflow.  The only tradeoff is the tiny memory increase: MAX_CLIENTS * sizeof(qboolean)

However, people do report getting the same "CL_GetServerCommand: a reliable command was cycled out" error when 'map_restart' is executed as opposed to loading a new map.  I still need to look into this.
Comment 9 Tony J. White 2006-10-09 17:29:02 EDT
Created attachment 1109 [details]
svn917 no configstring updates until CS_ACTIVE

* fix problem with map_restart from last patch
Comment 10 Tony J. White 2006-10-13 15:45:34 EDT
commited as changeset 935
Comment 11 Ryan C. Gordon 2007-05-21 11:23:13 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.