-
-
Notifications
You must be signed in to change notification settings - Fork 32k
http,https,http2: make async disposers idempotent #58832
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
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
@@ -580,10 +578,6 @@ Server.prototype.close = function close() { | |||
return this; | |||
}; | |||
|
|||
Server.prototype[SymbolAsyncDispose] = assignFunctionName(SymbolAsyncDispose, async function() { |
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.
Hmm does this make this a semver-major? This becomes a user observable change and if someone happens to be using an ERM polyfill I can imagine removing this breaking things.
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.
Right, I forgot that disposers graduated from experimental state since v24.2.0.
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.
Would it be better to split this into two patches, one to make the existing http* overrides idempotent, and another semver-major one to remove them?
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.
I think since they are stable, making them not throw would technically already be a breaking change. If not, splitting is indeed better.
Another option is separate backport PRs changing only the overrides.
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.
In most cases making an error into a non-error is not a breaking change. Obviously it can be, but so can adding a new function or option.
(I don't know if node has a policy to the contrary, just speaking generally.)
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.
Yeah, we've generally treated removing throws as something less than semver-major, and adding a throw as always semver-major, but often it's a case-by-case determination.
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.
For this PR, rather than removing the asyncDispose
, let's add a doc-only deprecation and make this one semver-patch.
Then, separately in another semver-major PR, we can runtime deprecate the asyncDispose
for the next major. Then once 25.0.0 is cut later this year we can open another semver-major that moves it to EOL.
Painful, yes, I know.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58832 +/- ##
==========================================
- Coverage 90.09% 90.08% -0.02%
==========================================
Files 640 640
Lines 188271 188356 +85
Branches 36923 36940 +17
==========================================
+ Hits 169625 169675 +50
- Misses 11386 11402 +16
- Partials 7260 7279 +19
🚀 New features to boost your workflow:
|
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.
lgtm
This PR makes
server[Symbol.asyncDispose]
calls not throw after the server is already closed.