-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Should invalid options for http2.session.shutdown() be checked before state shuttingDown is updated to true? #15666
Comments
Good spot! It should definitely be set only after the arguments are validated. Please include it with your PR for the tests, if possible. |
Thanks @apapirovski I'll set node/lib/internal/http2/core.js Lines 1026 to 1028 in 2f2f1cf
|
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. Refs: nodejs#14985 Fixes: nodejs#15666
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. PR-URL: #15676 Fixes: #15666 Refs: #14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. PR-URL: #15676 Fixes: #15666 Refs: #14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. PR-URL: #15676 Fixes: #15666 Refs: #14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. PR-URL: nodejs/node#15676 Fixes: nodejs/node#15666 Refs: nodejs/node#14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
In shutdown(), shuttingDown was set to true before validating options. If invalid options are passed, error was thrown and server remained in shuttingDown state. This code change fixes it. PR-URL: #15676 Fixes: #15666 Refs: #14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
I was writing unit tests for invalid options passed to http2.session.shutdown() as part of #14985 for
node/lib/internal/http2/core.js
Lines 999 to 1024 in 2f2f1cf
Should we check for invalid options before setting
this[kState].shuttingDown
to true?node/lib/internal/http2/core.js
Line 987 in 2f2f1cf
Currently, if there are invalid options:
this[kState].shuttingDown
is set to trueWhen shutdown is called for the second time, it returns because of the following check
node/lib/internal/http2/core.js
Lines 983 to 984 in 2f2f1cf
In this case, the only way to end the session is to destroy it.
The text was updated successfully, but these errors were encountered: