Skip to content

Race conditons between GC instances allow registering/deregistering multiple servers with the same invite code #79

@frosch123

Description

@frosch123

Race condition to registering a server

Steps:

  1. Start two servers with the same openttd.cfg / on the same machine as "local".
  2. 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:

  1. Same as above
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions