colyseus / proxy

🔀⚔ Proxy and Service Discovery for Colyseus 0.10 ~ 0.14 (Not recommended on 0.15+)
https://docs.colyseus.io/scalability/
MIT License
37 stars 25 forks source link

Self-cleaning of failed nodes and 503 unavailable status #10

Closed mobyjames closed 3 years ago

mobyjames commented 3 years ago

Previously the proxy would stall requests on error or when there are no nodes. This can happen if a node fails to gracefully shutdown or all nodes are down for maintenance or restarting.

This change attempts to detect failed nodes and to make and attempt at unregistering and cleaning up its presence. The request is then re-routed. If there are no nodes, status 503 is returned to prevent blocking the request indefinitely.

Possible improvements or issues

LukeWood commented 3 years ago

Looks like a great addition to me.

endel commented 3 years ago

Love this, thanks! ❤️