[Pipe] Fix processor worker starvation on pipe stop - #18396
Open
Caideyipi wants to merge 3 commits into
Open
Conversation
jt2594838
reviewed
Aug 5, 2026
Comment on lines
+276
to
280
| if (ExceptionUtils.getRootCause(e) instanceof PipeProcessorSubtaskYieldException) { | ||
| isResumingFromYield.set(true); | ||
| throw (PipeProcessorSubtaskYieldException) ExceptionUtils.getRootCause(e); | ||
| } | ||
| if (ExceptionUtils.getRootCause(e) instanceof PipeRuntimeOutOfMemoryCriticalException) { |
Contributor
There was a problem hiding this comment.
No need to call getRootCause multiple times.
Comment on lines
+25
to
+28
| private static final PipeProcessorSubtaskYieldException PAUSE_REQUESTED_INSTANCE = | ||
| new PipeProcessorSubtaskYieldException(Reason.PAUSE_REQUESTED); | ||
| private static final PipeProcessorSubtaskYieldException PARSER_NOT_ADMITTED_INSTANCE = | ||
| new PipeProcessorSubtaskYieldException(Reason.PARSER_NOT_ADMITTED); |
Contributor
There was a problem hiding this comment.
Creating a static exception instance may miss the actual stack traces.
Is it expected?
Comment on lines
+915
to
+920
| while (remainingTimeInMs > 0) { | ||
| processorExecutionGuard.check(); | ||
| Thread.sleep(Math.min(remainingTimeInMs, 100)); | ||
| processorExecutionGuard.check(); | ||
| remainingTimeInMs = deadlineInMs - System.currentTimeMillis(); | ||
| } |
Contributor
There was a problem hiding this comment.
Is it possible to register this thread with the guard and let it interrupt registered threads when the epoch changes?
Frequent sleep-and-wake may reduce performance.
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.
Description
Tests
mvn -o -nsu test -pl iotdb-core/datanode -Dtest=PipeProcessorSubtaskWorkerTest,PipeProcessorSubtaskExecutionGuardTest,PipeTsFileInsertionEventAdmissionTest,PipeMemoryManagerTest,PipeProcessorSubtaskExecutorTestmvn -o -nsu test -pl iotdb-core/datanode -Dtest=TsFileInsertionEventParserTestmvn -o test -pl iotdb-core/datanode -Dtest=PipeProcessorSubtaskWorkerTest,PipeProcessorSubtaskExecutionGuardTest -DfailIfNoTests=falsemvn -o compile -pl iotdb-core/datanode -P with-zh-locale