Repository navigation
[PR] fix: cancel invalidated keepalive timers on credential rotation - #6739
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
Conversation
This was referenced Nov 14, 2026
Merged
Merged
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #6737.
Problem
When a successful request changes credentials, keepalive removes the previous snapshot from its registry. If the new request has no eligible cache breakpoint, the function returns before cancelling the previous cadence timer. That callback continues holding the dropped snapshot and its body until the old deadline, outside the registry's concurrency cap.
With a concurrent cap of one, 20 arm/rotate/ineligible-request cycles leave no registered entry but 20 pending callbacks. A one-hour tier retains those callbacks until its existing 3,240-second cadence. The existing ownership check already prevents them from sending the old credential.
Change
Invalidate rotated snapshots through the existing
disarmoperation so registry removal also cancels their timer. Unchanged credentials retain the existing prior-snapshot behavior. An eligible replacement still installs one new timer, and other sessions remain untouched.Validation
a8bbb8d23108ba9148d09512927041364625d910: 4 new regressions fail, 2 controls pass, and the existing 39 tests pass.npm run typecheck,npm run build, andgit diff --checkpass. Full regression status is the remote CI result on this PR's head.The retention evidence is pending callbacks holding entry references; this PR does not claim a measured heap-size reduction or old-credential transmission.
Prior work
The original #3390 contains the direct registry deletion. My complete #6078 and #6238 patches and their issues cover response ownership and breakpoint discovery. Timer-unref work #5672 concerns event-loop liveness. None cancels an invalidated snapshot at this early-return path. This is also separate from #6735's unreadable response-body handling.