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: remove legacy parser #29589

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

Remove the legacy http_parser implementation as a dependency
and all code that uses it in favor of llhttp, given that the latter
has been the default for all of Node 12 with no outstanding issues.


I think one of the ideas behind making llhttp the default for v12.x is that that means that we could drop http_parser for Node 12 LTS, reducing the time that it needs to be supported. In that case, this should probably land soon-ish. I’m personally also okay with landing this before or after Node 13 only, if people prefer that.

@nodejs/tsc @nodejs/http

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

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Sep 17, 2019
@addaleax addaleax force-pushed the remove-legacy-http-parser branch from 8ec188b to d9adf95 Compare September 17, 2019 12:56
@addaleax addaleax added http Issues or PRs related to the http subsystem. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding. dont-land-on-v10.x and removed lib / src Issues and PRs related to general changes in the lib or src directory. labels Sep 17, 2019
@nodejs-github-bot
Copy link
Collaborator

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

I think this is semver-major.

@addaleax
Copy link
Member Author

I think this is semver-major.

@mcollina Do you mind explaining why? This doesn’t come with API changes, neither for the http module nor CLI flags, it only changes llhttp from being the default to being always-on.

@mcollina
Copy link
Member

We used to have a flag to switch between the two, have you removed that?

@addaleax
Copy link
Member Author

@mcollina It’s turned into a no-op here in order to make this as un-breaking as possible :)

@mcollina
Copy link
Member

@mcollina It’s turned into a no-op here in order to make this as un-breaking as possible :)

If somebody is relying on the legacy parser behavior, this would break them. I think it's better to remove the flag and call it semver-major.

@addaleax
Copy link
Member Author

If somebody is relying on the legacy parser behaviour in some way, then yes, this is semver-major – I’d consider the chances of that actually being the case pretty slim, though.

I wouldn’t want to remove the flag in this PR either way. (Honestly, I personally wouldn’t want to remove any flags that can reasonably be turned into no-ops, ever.) That can happen later and seems like a different concern to me.

@addaleax
Copy link
Member Author

Anyway, if you think this is semver-major, feel free to add the label. As the PR description says, I’m fine with that, even if I don’t think it’s necessary.

@mcollina
Copy link
Member

I'm tagging this tsc-agenda, just to poll the @nodejs/tsc. If the TSC has no objection, I'm happy for a semver-minor.

@mcollina mcollina added the tsc-agenda Issues and PRs to discuss during the meetings of the TSC. label Sep 17, 2019
@sam-github
Copy link
Contributor

I think removing a feature is semver-major, so removing http_parser is semver-major. There have been differences between parsers noticed in the past, being careful here seems a good thing to me.

Removing the CLI option would also be semver-major, even if it is a no-op.

Working around different CLI options for different node.js versions is difficult, so I'm in favour of leaving the CLI option to select the http_parser around even after the parser is gone, though perhaps it should print a warning saying that it isn't actually doing anything?

@jasnell
Copy link
Member

jasnell commented Sep 17, 2019

hmm... tough one. I can see your rationale on this for semver-minor @addaleax. That said, our deprecation policy requires that End-of-life transitions are semver-major, and there's a likely-very-small-but-still-non-zero possibility that someone is building a native addon somewhere that depends on the presence of the http_parser.h headers, regardless of whether they are depending on any of the actual behaviors implemented. I think to be safe we have to consider this a semver-major change.

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Sep 17, 2019
@jasnell
Copy link
Member

jasnell commented Sep 17, 2019

Marking semver-major for now, but this should definitely be discussed on the TSC meeting.

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.

RSLGTM

@lpinca
Copy link
Member

lpinca commented Sep 17, 2019

There seem to be a spurious commit was this done on purpose?

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM as a semver-major (and with the extraneous commit removed)

Remove the legacy `http_parser` implementation as a dependency
and all code that uses it in favor of llhttp, given that the latter
has been the default for all of Node 12 with no outstanding issues.
@addaleax addaleax force-pushed the remove-legacy-http-parser branch from d9adf95 to 1f86ad0 Compare September 17, 2019 19:37
@addaleax
Copy link
Member Author

I think removing a feature is semver-major, so removing http_parser is semver-major.

I don’t think this qualifies as a feature, it’s a change in implementation details. The only question is whether it’s a big enough one to have to be more careful than usual here.

There seem to be a spurious commit was this done on purpose?

That seems to be @Trott rebasing nodejs/master. I’ve rebased this against master again, the extra commit is gone.

That said, our deprecation policy requires that End-of-life transitions are semver-major

(I don’t really understand why this was deprecated, either.)

and there's a likely-very-small-but-still-non-zero possibility that someone is building a native addon somewhere that depends on the presence of the http_parser.h headers, regardless of whether they are depending on any of the actual behaviors implemented.

We don’t publish the http parser headers along with Node, and we don’t re-export the symbols on Windows. I think it’s safe to say that this isn’t a concern here.

@jasnell
Copy link
Member

jasnell commented Sep 17, 2019

We don’t publish the http parser headers along with Node, and we don’t re-export the symbols on Windows. I think it’s safe to say that this isn’t a concern here.

👍

Ok, well, I'm good with the change overall. If there are no objections from the rest of the TSC on dropping the semver-major on this, then I'm good with that also, but as it is right now because of the deprecation it's technically semver-major :-/

codebytere added a commit to electron/electron that referenced this pull request Sep 14, 2020
codebytere added a commit to electron/electron that referenced this pull request Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http_parser Issues and PRs related to the HTTP Parser dependency or the http_parser binding. http Issues or PRs related to the http subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.