Page MenuHomeWildfire Games

Fix unknown GUID errors when rejoining while another client rejoins at an unlucky time
ClosedPublic

Authored by elexis on Jan 11 2020, 2:34 AM.

Details

Summary

As identified in #5660, the pregame_mp page continues to proces all pending netmessages until there is no further one left.

If there is a "start" and a "players" message pending, then it will switch the page to session with the old player assignments, then update the obsolete "gamesetup_mp" rejoining page with the new player assignments, discard that page with the assignments, and then run the session with the obsolete playerassignments and error out.

This behavior was there since the beginning in rP10452.

Test Plan

Seems impossible to reproduce, it is a strong race condition, probably depends on lag and perhaps even on "CPU lag" too. While lag can easily be simulated, I failed to reproduce it naturally.
But from reading the code it is clear that if these two messages pending, that the player message will be processed incorrectly without the patch but correctly with the patch.
See the comment in the trac ticket to see how to reproduce these JS errors artificially with the described gamesetup_mp malfunction.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Jan 11 2020, 2:34 AM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1005/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
| 212| 212| 				error("Unrecognised net message type: " + message.type);
| 213| 213| 			}
| 214| 214| 		else
| 215|    |-			// Not rejoining - just trying to connect to server
|    | 215|+		// Not rejoining - just trying to connect to server
| 216| 216| 
| 217| 217| 			switch (message.type)
| 218| 218| 			{
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1523/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/101/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Jan 15 2020, 2:34 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jan 15 2020, 2:34 PM