Skip to content

[Pipe] Drop builtin sinks synchronously - #18646

Open
Caideyipi wants to merge 1 commit into
masterfrom
fix/builtin-sink-synchronous-drop
Open

Caideyipi wants to merge 1 commit into
masterfrom
fix/builtin-sink-synchronous-drop

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Make builtin sink cleanup synchronous when a pipe is dropped.

Behavior

  • Builtin sinks, including the subscription sink, acquire the sink operation lock, discard buffered events, and close the connector on the caller thread.
  • External sinks keep the existing timeout-bounded asynchronous cleanup behavior so third-party connector implementations cannot block pipe drop indefinitely.
  • Sink classification is centralized in BuiltinPipePlugin.BUILTIN_SINKS, including connector names, sink names, and legacy aliases.

Tests

Added regression coverage for:

  • builtin sink discard waiting for an in-progress connection retry;
  • external sink discard remaining non-blocking during connection retry;
  • builtin sink close waiting for connector close;
  • external sink close retaining its timeout behavior.

This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added comments explaining the why and the intent of the code wherever it would not be obvious.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • PipeSinkSubtask
  • PipeSinkSubtaskManager
  • SubscriptionSinkSubtask
  • BuiltinPipePlugin
  • PipeSinkSubtaskTest

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.82%. Comparing base (a05c63e) to head (420ecd7).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
.../pipe/agent/task/subtask/sink/PipeSinkSubtask.java 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18646   +/-   ##
=========================================
  Coverage     42.82%   42.82%           
  Complexity      442      442           
=========================================
  Files          5451     5451           
  Lines        395425   395467   +42     
  Branches      51805    51807    +2     
=========================================
+ Hits         169349   169378   +29     
- Misses       226076   226089   +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant