Skip to content

Conversation

@legendecas
Copy link
Member

The certs could be allocated in a pooled buffer, like Buffer.from, and
Buffer.allocUnsafe (used by fs.readFileSync, etc).

Refs: #61372

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jan 16, 2026
@legendecas legendecas added the quic Issues and PRs related to the QUIC implementation / HTTP/3. label Jan 16, 2026
Copy link
Member

@Renegade334 Renegade334 left a 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.

@legendecas legendecas force-pushed the quic-certs branch 2 times, most recently from da77e1e to b8f90b8 Compare January 16, 2026 21:27
@legendecas legendecas changed the title quic: copy options.certs buffer instead of detaching quic: copy optionsbuffer instead of detaching Jan 16, 2026
@legendecas legendecas changed the title quic: copy optionsbuffer instead of detaching quic: copy options buffer instead of detaching Jan 16, 2026
The certs could be allocated in a pooled buffer, like `Buffer.from`, and
`Buffer.allocUnsafe` (used by `fs.readFileSync`, etc).
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (e3071d5) to head (7a9130c).
⚠️ Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
src/quic/data.cc 52.63% 9 Missing ⚠️
src/quic/tlscontext.cc 25.00% 3 Missing ⚠️
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     
Files with missing lines Coverage Δ
src/quic/data.h 36.36% <ø> (-27.28%) ⬇️
src/quic/endpoint.cc 56.64% <100.00%> (+0.12%) ⬆️
src/quic/tlscontext.cc 37.47% <25.00%> (+0.62%) ⬆️
src/quic/data.cc 52.08% <52.63%> (-2.67%) ⬇️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 18, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 18, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@avivkeller avivkeller added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 19, 2026
auto length = view->ByteLength();
auto offset = view->ByteOffset();
auto dest = ArrayBuffer::NewBackingStore(
isolate, length, v8::BackingStoreInitializationMode::kUninitialized);
Copy link
Member

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

Copy link
Member Author

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.

@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 22, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 22, 2026
@nodejs-github-bot
Copy link
Collaborator

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: 500
https://github.com/nodejs/node/actions/runs/21252560285

@legendecas legendecas added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jan 22, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 22, 2026
@nodejs-github-bot nodejs-github-bot merged commit 41c6256 into nodejs:main Jan 22, 2026
78 of 79 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 41c6256

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. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants