Skip to content

How can it perform a rolling update without downtime? #4857

Answered by darrachequesne
rikuson asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

Does this feature only apply to client-side disconnections?

No, it also works when the Socket.IO server is cleanly stopped:

process.on('SIGTERM', () => {
  io.close();
});

The connections will be closed with a server shutting down reason, which is in the list of recoverable reasons:

socket.io/lib/socket.ts

Lines 50 to 57 in 9a2a83f

const RECOVERABLE_DISCONNECT_REASONS: ReadonlySet<DisconnectReason> = new Set([
"transport error",
"transport close",
"forced close",
"ping timeout",
"server shutting down",
"forced server close",
]);

So the connection state will be persisted in the store (if the process has enough time to do so) and re…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rikuson
Comment options

Answer selected by rikuson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants