Skip to content

[Pipe] Fix processor worker starvation on pipe stop - #18396

Merged
jt2594838 merged 6 commits into
apache:masterfrom
Caideyipi:fix/pipe-processor-cooperative-yield
Aug 11, 2026
Merged

[Pipe] Fix processor worker starvation on pipe stop#18396
jt2594838 merged 6 commits into
apache:masterfrom
Caideyipi:fix/pipe-processor-cooperative-yield

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Add an epoch-based execution guard so a processor invocation that observes STOP yields even if the pipe is immediately started again.
  • Check the guard around TsFile-close waits, parser admission, Tablet boundaries, and OOM backoff; yielding is neutral control flow and preserves the current event and parsing progress.
  • Make parser admission non-blocking for processor subtasks so a task that is not admitted immediately yields its worker while keeping its fair-queue request.
  • Cancel pending parser requests on STOP and release active parser reservations from the processor worker before yielding.
  • Add a deterministic shared-worker test covering a stopped Pipe, a parser-waiting Pipe, and a running Pipe in the same worker round.
  • Watch each processor worker for a continuously running event. Log the worker stack after 10 minutes and at most once every 30 minutes for the same event; cap the event description at 1 KiB and the stack at 64 frames.

Tests

  • mvn -o -nsu test -pl iotdb-core/datanode -Dtest=PipeProcessorSubtaskWorkerTest,PipeProcessorSubtaskExecutionGuardTest,PipeTsFileInsertionEventAdmissionTest,PipeMemoryManagerTest,PipeProcessorSubtaskExecutorTest
  • mvn -o -nsu test -pl iotdb-core/datanode -Dtest=TsFileInsertionEventParserTest
  • mvn -o test -pl iotdb-core/datanode -Dtest=PipeProcessorSubtaskWorkerTest,PipeProcessorSubtaskExecutionGuardTest -DfailIfNoTests=false
  • mvn -o compile -pl iotdb-core/datanode -P with-zh-locale

….com/Caideyipi/iotdb into fix/pipe-processor-cooperative-yield

# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/processor/PipeProcessorSubtask.java
@jt2594838
jt2594838 merged commit 3c0c7fe into apache:master Aug 11, 2026
40 of 41 checks passed
@jt2594838
jt2594838 deleted the fix/pipe-processor-cooperative-yield branch August 11, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants