[hotfix][Optimizer] Remove zero-valued in-flight task counters - #4328
Open
czy006 wants to merge 1 commit into
Open
[hotfix][Optimizer] Remove zero-valued in-flight task counters#4328czy006 wants to merge 1 commit into
czy006 wants to merge 1 commit into
Conversation
czy006
marked this pull request as ready for review
August 17, 2026 09:13
optimizingTasksMap kept a zero-count AtomicInteger entry forever after a table's last task completed: poll created entries via computeIfAbsent, acceptResult decremented but always returned the holder, and neither releaseTable nor dispose cleaned up. Every table that ever had a polled task (including deleted tables and tables that moved groups) permanently occupied one map slot. Switch acceptResult to an atomic compute that removes the entry at zero (keeping the >0 decrement guard; late accepts on a removed entry are no-ops instead of resurrecting it), and clear the entry in releaseTable/dispose. Regression test testTasksMapEntryRemovedAfterTaskCompletes (red before: map size stayed 1). Full TestOptimizingQueue 47/47 green. Fix record: docs/fix-records/2026-08-16-fix-19-optimizing-tasks-map-leak.md
czy006
force-pushed
the
codex/hotfix-optimizer-inflight-counter-cleanup
branch
from
August 18, 2026 02:16
cd3d1df to
8cf614a
Compare
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.
Brief change log
Remove the per-table in-flight task-counter entry when its count returns to zero, while preserving counters for active tasks. This prevents the counter map from retaining completed-table entries indefinitely.
How was this patch tested?
TestOptimizingQueue#testInFlightCounterEntryRemovedAfterTaskCompleteslocally with JDK 11 before creating this pull request.Documentation