-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
zlib: throw brotli initialization error from c++ #54698
Conversation
899e914
to
25d076f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54698 +/- ##
=======================================
Coverage 88.07% 88.07%
=======================================
Files 651 651
Lines 183538 183530 -8
Branches 35862 35862
=======================================
- Hits 161647 161645 -2
+ Misses 15136 15135 -1
+ Partials 6755 6750 -5
|
cc @nodejs/cpp-reviewers |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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 comment was marked as outdated.
This comment was marked as outdated.
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.
No strong feelings about the code being moved around, but the TODO comment here is about the error codes themselves, not where they are thrown, so it should be moved as well
@@ -816,14 +815,8 @@ function Brotli(opts, mode) { | |||
new binding.BrotliDecoder(mode) : new binding.BrotliEncoder(mode); | |||
|
|||
this._writeState = new Uint32Array(2); | |||
// TODO(addaleax): Sometimes we generate better error codes in C++ land, | |||
// e.g. ERR_BROTLI_PARAM_SET_FAILED -- it's hard to access them with | |||
// the current bindings setup, though. |
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.
Please don't remove this TODO comment until it's actually addressed :)
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 I misunderstood the TODO in here. Can you explain if you don't mind?
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, the TODO is about surfacing the actual error codes we get from the underlying library, instead of a generic "initialization failed" error code – ERR_BROTLI_PARAM_SET_FAILED
being one example of that
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 reverted the change. Thank you for the review.
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.
Do you want to move the TODO comment along to the new throw sites?
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 moved it. There is 2 occurrences where we throw the error on C++. For the sake of reducability, I just kept the TODO on one of them.
25d076f
to
7dd40f8
Compare
Commit Queue failed- Loading data for nodejs/node/pull/54698 ✔ Done loading data for nodejs/node/pull/54698 ----------------------------------- PR info ------------------------------------ Title zlib: throw brotli initialization error from c++ (#54698) Author Yagiz Nizipli <[email protected]> (@anonrig) Branch anonrig:yagiz/zlib-throw-err -> nodejs:main Labels c++, zlib, lib / src, needs-ci Commits 1 - zlib: throw brotli initialization error from c++ Committers 1 - Yagiz Nizipli <[email protected]> PR-URL: https://github.com/nodejs/node/pull/54698 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/54698 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 01 Sep 2024 16:50:17 GMT ✘ Requested Changes: 1 ✘ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/54698#pullrequestreview-2278408395 ✔ Approvals: 3 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/54698#pullrequestreview-2275983863 ✔ - Gerhard Stöbich (@Flarna): https://github.com/nodejs/node/pull/54698#pullrequestreview-2297007257 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/54698#pullrequestreview-2277663481 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-09-11T02:55:54Z: https://ci.nodejs.org/job/node-test-pull-request/62297/ - Querying data for job/node-test-pull-request/62297/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/10812657737 |
@anonrig feel free to dismiss my review if you think the TODO comment should remain where it is (it doesn't make sense to me in its current location where it's pretty unclear now what kind of error it's talking about) |
I'll move the comment location, just didn't had any time yet. |
7dd40f8
to
fef6ffc
Compare
PR-URL: #54698 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 5b3f3c5 |
PR-URL: #54698 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#54698 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]>
Completes a 6 year old TODO by @addaleax introduced at 73753d4