NorthstarLauncher
NorthstarLauncher copied to clipboard
Server not retrying registration after failure
With https://github.com/R2Northstar/NorthstarMasterServer/pull/67 a server auto-restarting after a crash might be blocked by its ghosted hogging the ip:port combo until timeout. The problem is that if the restarted server doesn't retry for registration (with some timeout between attempts) it will never re-register and as such not display on server browser.
From a client's perspective it will look like the server never came back after crashing.
Here's what I know about this:
- If a server tries to register more than 30 seconds after the remnant of it's last heartbeat it should be added fine
- Calling server/remove_server from the dedicated server on close should fix this issue entirely
Calling server/remove_server from the dedicated server on close should fix this issue entirely
That sadly wouldn't solve the case where a server hard-crashes and then gets restarted by e.g. docker-compose. In such a case due to the hard crash the server never had the chance to call /server/remove_server.
Simply retrying registration if it fails on start-up (depending on error response) seems like the simplest solution to me ^^
(We should obviously still have servers call /server/remove_server on normal shutdown.)
Simply retrying registration if it fails on start-up (depending on error response) seems like the simplest solution to me ^^ (We should obviously still have servers call
/server/remove_serveron normal shutdown.)
https://github.com/RomeoCantCode/NorthstarLauncher/commit/37b38d6d52deef7f095bcc0314c4de7621a339ec 😄
Also I think the server should check if it was gracefully shut down before. If not it should call /server/remove_server using the previous serverID (would require storing the serverID and like a gracefulshutdown flag on FS).
Also as a side note. If you gracefully shut down the server (using quit command) it will call /server/remove_server but it seems not doing so if you close the console / close server process in some other way.
using the previous serverID (would require storing the serverID and like a gracefulshutdown flag on FS).
I doubt the server could save ID on crash if it can't call /server/remove. We could obviously store it before but we have edge cases like the docker container, where most files are immutable and not stored back to disk. I think the 30s wait to re-register server on crash is honestly fine, so as long as we retry we shouldn't really have an issue. ^^
RomeoCantCode@37b38d6 smile
You maybe wanna PR that? :3
Needs testing also I don't like goto 😞 also this leads to clients trying to auth as server every 30s while playing because report to master server is enabled by default.
Needs testing also I don't like goto :disappointed:
Agreed but I'd still suggest making one as a draft so it's clear that someone started to look into it :P