Race condition to registering a server
Steps:
- Start two servers with the same openttd.cfg / on the same machine as "local".
- Switch both servers to "invite" or "public" at the same time.
Now both servers connect to different GC instances and try to register with the same invite code.
There is a window of about 2 seconds, where both registrations succeed.
- Both GC instances will think they own the server, and report success to the server.
- One server will win in redis, but that does not matter unless the GC instances restart.
Race condition to deregistering a server
Steps:
- Same as above
- Exit both servers at the same time, e.g. using
killall -9 openttd.
Now both GC instances will
- detect that their server exited,
- will delete the server, and
- inform the other instance of the deletion.
This can cause a KeyError exception in coordinator.py: remove_server()
- The invite code is checked at the beginning of remove_server()
- During any
await inside remove_server() the remove-notification from the other instance may be received.
- The
del at the end throws, because the server was already deleted.