-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(websockets): Prevent HTTP server early close in Socket.IO shutdown #14185
fix(websockets): Prevent HTTP server early close in Socket.IO shutdown #14185
Conversation
Pull Request Test Coverage Report for Build 1f935bcf-2e20-49d2-8b77-6a4688c12cf5Details
💛 - Coveralls |
LGTM |
@@ -35,6 +40,9 @@ export abstract class AbstractWsAdapter< | |||
} | |||
|
|||
public async close(server: TServer) { | |||
if (this._forceCloseConnections) { | |||
return; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sapenlei I just realized that this method should be called no matter the _forceCloseConnections
for non-shared WS servers. This doesn't seem to be the case atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even for non-shared ws servers, their connections are destroyed and the final shutdown is closed by express
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come? What if you use a port different from the HTTP application?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, there's a problem. I'll fix it tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kamilmysliwiec I fixed it #14204
fixes #13910
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #13910
What is the new behavior?
When ws connections and other long-running connections are handled by the same HTTP server instance, the shutdown process will not be blocked, allowing for proper termination of all connection types.
Does this PR introduce a breaking change?
Other information