-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
quic: copy options buffer instead of detaching #61403
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
Conversation
Renegade334
left a comment
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.
Was going to suggest a similar approach.
The commit message should probably reflect that this applies to all buffer-based quic options, not just SessionOptions#certs.
da77e1e to
b8f90b8
Compare
The certs could be allocated in a pooled buffer, like `Buffer.from`, and `Buffer.allocUnsafe` (used by `fs.readFileSync`, etc).
b8f90b8 to
7a9130c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61403 +/- ##
==========================================
- Coverage 88.53% 88.51% -0.02%
==========================================
Files 704 704
Lines 208797 208806 +9
Branches 40316 40308 -8
==========================================
- Hits 184857 184834 -23
- Misses 15923 15971 +48
+ Partials 8017 8001 -16
🚀 New features to boost your workflow:
|
| auto length = view->ByteLength(); | ||
| auto offset = view->ByteOffset(); | ||
| auto dest = ArrayBuffer::NewBackingStore( | ||
| isolate, length, v8::BackingStoreInitializationMode::kUninitialized); |
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 be nice if we could handle allocation failures in these calls too
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.
You are right. I think we can use BackingStoreOnFailureMode to gracefully handle the failure. Given that there are many ArrayBuffer::NewBackingStore call sites in the codebase, I could file a follow-up to bulk update.
Commit Queue failed- Loading data for nodejs/node/pull/61403 ✔ Done loading data for nodejs/node/pull/61403 ----------------------------------- PR info ------------------------------------ Title quic: copy options buffer instead of detaching (#61403) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch legendecas:quic-certs -> nodejs:main Labels c++, lib / src, author ready, needs-ci, quic Commits 1 - quic: copy options.certs buffer instead of detaching Committers 1 - Chengzhong Wu <cwu631@bloomberg.net> PR-URL: https://github.com/nodejs/node/pull/61403 Refs: https://github.com/nodejs/node/pull/61372 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61403 Refs: https://github.com/nodejs/node/pull/61372 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 16 Jan 2026 20:26:08 GMT ✔ Approvals: 2 ✔ - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/61403#pullrequestreview-3674325947 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/61403#pullrequestreview-3687646808 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-01-19T23:08:55Z: https://ci.nodejs.org/job/node-test-pull-request/70898/ - Querying data for job/node-test-pull-request/70898/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... remote: Internal Server Error fatal: unable to access 'https://github.com/nodejs/node/': The requested URL returned error: 500https://github.com/nodejs/node/actions/runs/21252560285 |
|
Landed in 41c6256 |
The
certscould be allocated in a pooled buffer, likeBuffer.from, andBuffer.allocUnsafe(used byfs.readFileSync, etc).Refs: #61372