GiganticMinecraft / BungeeSemaphore

A BungeeCord plugin for controlling access to data shared among downstream servers
MIT License
1 stars 0 forks source link

Potential Race Condition on Semaphoring Switcher Protocol #8

Open kory33 opened 1 year ago

kory33 commented 1 year ago

The protocol described here

https://github.com/GiganticMinecraft/BungeeSemaphore/blob/bcd5886827c813c75eb31d6f6fa926e0e8e0fd4f/src/main/scala/click/seichi/bungeesemaphore/infrastructure/bugeecord/listeners/SemaphoringServerSwitcher.scala#L36-L45

potentially introduces a race condition because BungeeCord plugin (this is us) may initiate the Redis request after Spigot plugin has reported to Redis the completion of the data persistence (although this is very unlikely).

We can avoid this problem by having the "step 3" done before "step 2", since Redis then serializes write requests in the desired order.

kory33 commented 1 year ago

Actually, the issue does not exist. Implementation is entirely correct, and it is just the documentation having the sequence diagram wrong.