[hotfix][Optimizer] Recognize CLOSED optimizing processes - #4331
Open
czy006 wants to merge 1 commit into
Open
Conversation
czy006
marked this pull request as ready for review
August 17, 2026 09:11
close() sets ProcessStatus.CLOSED while isClosed() only compared against KILLED - a status never assigned in this class - so the predicate was permanently false and acceptResult's OptimizingClosedException guard against late results on a closed process could never fire (downstream isProcessing conditions happened to contain the fallout). Check both CLOSED and KILLED. Reachability analysis in the fix record: close(false) cancels tasks so late completes fail earlier with IllegalTaskStateException, and the partial-commit path legitimately accepts late results; no public-API path drives the guard today, so this lands as an intent fix verified by the full queue regression (47/47) rather than a behavioral red test. Fix record: docs/fix-records/2026-08-16-fix-22-is-closed-status-mismatch.md
czy006
force-pushed
the
codex/hotfix-optimizer-closed-status
branch
from
August 18, 2026 02:16
65aadac to
96a97b2
Compare
xxubai
reviewed
Aug 18, 2026
| @@ -775,7 +775,10 @@ private void resetTask(TaskRuntime<RewriteStageTask> taskRuntime) { | |||
|
|
|||
| @Override | |||
| public boolean isClosed() { | |||
Contributor
There was a problem hiding this comment.
I'm wondering why we need isClosed() if we already have getStatus(). If it represents something other than the process status, we should either rename it to make its semantics clearer or remove it and use getStatus() instead.
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
Make
OptimizingProcess.isClosed()recognize theCLOSEDstatus set byclose(), in addition toKILLED. This restores the guard against accepting late results for a closed optimizing process.How was this patch tested?
TestOptimizingQueue#testProcessCloseKeepsLastOptimizedSnapshotIdlocally with JDK 11 before creating this pull request.Documentation