Use field updaters for timeout guards#2263
Closed
pavel-ptashyts wants to merge 1 commit into
Closed
Conversation
Replace per-instance AtomicBoolean guards in TimeoutsHolder and TimeoutTimerTask with volatile int fields managed by static AtomicIntegerFieldUpdaters. This preserves run-once and cleanup semantics while avoiding an extra guard object allocation per timeout holder and task. Add unit coverage for idempotent TimeoutTimerTask cleanup. Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex <codex@openai.com>
pavel-ptashyts
force-pushed
the
perf/timeout-field-updaters
branch
from
July 20, 2026 08:50
19a8b49 to
863afec
Compare
Contributor
Author
|
Closing this for the 3.x line because Revapi correctly reports the removal of the protected TimeoutTimerTask.done field as an incompatible API change. Retaining the AtomicBoolean field would retain the allocation this change is intended to remove, while adding a Revapi exception would silently break external subclasses. This optimization can be reconsidered for a major release; the branch is retained as a reference. |
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.
Summary
Verification
Attribution
Codex on behalf of Pavel Ptashyts