Skip to content

[To dev/1.3] [Pipe] Fix pipe sink metrics lifecycle race (#18722) - #18764

Open
Caideyipi wants to merge 1 commit into
apache:dev/1.3from
Caideyipi:fix/pipe-sink-metrics-lifecycle-race-dev-1.3
Open

Caideyipi wants to merge 1 commit into
apache:dev/1.3from
Caideyipi:fix/pipe-sink-metrics-lifecycle-race-dev-1.3

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Backport of #18722 (commit ce6c1f5f477b2da5b5071890c715c6b6a9652e45) to dev/1.3.

PipeDataRegionSinkMetrics now serializes bindTo, unbindFrom, register, and deregister so a sink task remains present throughout metric creation and removal. This prevents concurrent deregistration from causing a null pointer exception while metrics are being bound during DataNode startup.

The source conflict was adapted to the dev/1.3 connector naming and API; the regression test uses the branch's existing getConnectorIndex() method.

Verification

  • .\mvnw.cmd --% -pl iotdb-core/datanode spotless:apply -Ddevelocity.off=true
  • .\mvnw.cmd --% -pl iotdb-core/datanode -Dtest=PipeDataRegionSinkMetricsTest test -Ddevelocity.off=true
  • Build succeeded; the targeted test passed in both configured Surefire executions with 0 failures and 0 errors.

This PR has:

  • been self-reviewed.
    • concurrent read and write
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.

Key changed/added classes in this PR
  • PipeDataRegionSinkMetrics
  • PipeDataRegionSinkMetricsTest

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