Skip to content
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

http: allow passing callbacks for [Incoming,Outgoing]Message#destroy #33907

Closed
wants to merge 1 commit into from

Conversation

rexagod
Copy link
Member

@rexagod rexagod commented Jun 16, 2020

Fixes: #28236

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Jun 16, 2020
@lpinca
Copy link
Member

lpinca commented Jun 16, 2020

I think we wanted to remove the callback from public destroy(), only the _destroy() implementation should take a callback.

cc: @nodejs/streams @ronag

@lpinca lpinca added the stream Issues and PRs related to the stream subsystem. label Jun 16, 2020
@ronag
Copy link
Member

ronag commented Jun 16, 2020

I think we wanted to remove the callback from public destroy(), only the _destroy() implementation should take a callback.

Yup. This is an undocumented API we would like to remove.

You should do the following instead:

x.destroy(er)
finished(er, cb)

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag
Copy link
Member

ronag commented Jun 16, 2020

If we can backport this to 12 it would be good. It would fix #28236 which is already fixed on 14+ but that was through a semver-major change.

Copy link
Member

@lpinca lpinca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved away from using the internal only, undocumented destroy(err, cb) api. This moves in the opposite direction and makes the api public.

@ronag
Copy link
Member

ronag commented Jun 16, 2020

We moved away from using the internal only, undocumented destroy(err, cb) api. This moves in the opposite direction and make the api public.

I agree, but it does fix a bug in v12 which would otherwise require a semver major change.

EDIT: I guess that could be fixed in a non semver-major way that does not require this PR... if a bit hackish.

@lpinca
Copy link
Member

lpinca commented Jun 16, 2020

I would rather keep the bug than exposing an internal only, soon to be removed, api as public.

@rexagod rexagod requested a review from a team as a code owner August 10, 2020 16:06
@aduh95 aduh95 added the stalled Issues and PRs that are stalled. label Oct 16, 2020
@github-actions
Copy link
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

@github-actions
Copy link
Contributor

Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.

@github-actions github-actions bot closed this Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. stalled Issues and PRs that are stalled. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IncomingMessage and OutgoingMessage's destroy ignores the second argument callback, swallowing the error
6 participants