GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [v7.x] fix(session cache): fix bug in tls session caching (#5882) by mrityunjay-pandey · Pull Request #6017 · nodejs/undici

Conversation

@mrityunjay-pandey

@mrityunjay-pandey mrityunjay-pandey commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

This relates to...

Backport of #5882 to v7.x.

Rationale

WeakSessionCache.set() on v7.x has the bug fixed by #5882. When the cache is full and it finds an entry whose session was already collected, it deletes that entry and then returns, so the new session is never stored. With a full cache, a new TLS session is silently dropped whenever there is a dead entry to clean up.

v6.x is not affected: its WeakSessionCache has no eviction logic, which came in with #5102.

Changes

  • Cherry-pick d983b4f (fix(session cache): fix bug in tls session caching #5882) onto v7.x. It applies cleanly.
  • It includes test/tls-session-cache.js. Before the fix, that test fails on v7.x because session C is not cached: expected { name: 'C' }, actual null.

Features

N/A

Bug Fixes

  • TLS session cache: a new session is stored after an expired entry is evicted.

Breaking Changes and Deprecations

N/A

Status

  • I have read and agreed to the Developer's Certificate of Origin
  • Tested
  • Benchmarked (optional)
  • Documented
  • Review ready
  • In review
  • Merge ready

Tested locally on Linux with Node 24: npm run test:unit (1322 tests, 1319 pass, 3 skipped, 0 fail) and npm run lint.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell @mrityunjay-pandey
fix(session cache): fix bug in tls session caching (nodejs#5882)
f333785
Spotted this one by accident. In the tls session cache,
nodejs#5102 added logic
to remove dead entries and make room, but the check
used an early return that short circuited the cache
operation.

Signed-off-by: James M Snell <[email protected]>
(cherry picked from commit d983b4f)
Signed-off-by: Mrityunjay Pandey <[email protected]>
@codecov-commenter

codecov-commenter commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (0c74bec) to head (f333785).

Additional details and impacted files
@@            Coverage Diff             @@
##             v7.x    #6017      +/-   ##
==========================================
+ Coverage   93.11%   93.12%   +0.01%     
==========================================
  Files         112      112              
  Lines       37366    37372       +6     
==========================================
+ Hits        34793    34804      +11     
+ Misses       2573     2568       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Oct 15, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina
mcollina merged commit 1dc0696 into nodejs:v7.x Oct 15, 2026
37 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Oct 15, 2026
[Release] v7.30.1 #6022
Merged
This was referenced Oct 24, 2026
refactor: Bump undici from 6.27.0 to 6.29.1 and 7.28.0 to 7.30.1 parse-community/node-apn#226
Merged
refactor: Bump undici from 6.27.0 to 6.29.1 and 7.28.0 to 7.30.1 parse-community/Parse-SDK-dotNET#436
Merged
refactor: Bump undici from 6.27.0 to 6.29.1 and 7.28.0 to 7.30.1 parse-community/parse-server-example#947
Merged
refactor: Bump undici from 6.28.1 to 6.29.1, 7.29.1 to 7.30.1 and 7.30.0 to 7.30.1 parse-community/parse-server-sqs-mq-adapter#460
Merged
refactor: Bump undici from 6.29.0 to 6.29.1 and 7.30.0 to 7.30.1 parse-community/parse-server-api-mail-adapter#307
Merged
fix: Bump undici from 6.28.1 to 6.29.1 and 7.29.1 to 7.30.1 parse-community/parse-server-push-adapter#636
Merged
refactor: Bump undici from 6.28.1 to 6.29.1, 7.29.1 to 7.30.1 and 7.30.0 to 7.30.1 parse-community/parse-dashboard#3510
Merged
refactor: Bump undici from 7.24.6 to 7.30.1 parse-community/Parse-SDK-Flutter#1179
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mrityunjay-pandey @codecov-commenter @mcollina @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.