Skip to content

Remove some printed errMsg when stop DN - #18799

Merged
JackieTien97 merged 3 commits into
masterfrom
fixStopDN
Oct 10, 2026
Merged

JackieTien97 merged 3 commits into
masterfrom
fixStopDN

Conversation

@Wei-hao-Li

@Wei-hao-Li Wei-hao-Li commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Problem
During DataNode shutdown, an active query may be interrupted and transition to FAILED. Its resources can then be cleaned up concurrently through two paths:
Path 1: FragmentInstance state-change listener
→ Close drivers
→ Force-deregister the FI from the memory pool

Path 2: DriverScheduler abort
→ forceDeregisterFragmentInstance
→ SourceHandle.abort
→ MemoryPool.free
If Path 1 removes the FI memory registration firstly, it will throw MemoryLeakException because some PlanNode memory reservations are still non-zero.
Path 2 may subsequently attempt to release memory retained by a SourceHandle. Since the Query/FI registration has already been removed, MemoryPool.free() throws IllegalArgumentException:
RelatedMemoryReserved can't be null when freeing memory.

Fix
Checks isStopping before logging query cleanup errors in. And move setStopping before stop ExternalRPCService to ensure Stopping is set before query failed.

Signed-off-by: Weihao Li <18110526956@163.com>
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.85%. Comparing base (b94aa09) to head (2b01d11).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../execution/fragment/FragmentInstanceExecution.java 0.00% 4 Missing ⚠️
...ueryengine/execution/schedule/DriverScheduler.java 0.00% 4 Missing ⚠️
.../apache/iotdb/db/service/DataNodeShutdownHook.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18799      +/-   ##
============================================
+ Coverage     45.83%   45.85%   +0.01%     
  Complexity      712      712              
============================================
  Files          5498     5498              
  Lines        397501   397505       +4     
  Branches      51737    51741       +4     
============================================
+ Hits         182200   182278      +78     
+ Misses       215301   215227      -74     

☔ 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.

Signed-off-by: Weihao Li <18110526956@163.com>
Signed-off-by: Weihao Li <18110526956@163.com>

# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeShutdownHook.java
@JackieTien97
JackieTien97 merged commit 741a13a into master Oct 10, 2026
39 of 42 checks passed
@JackieTien97
JackieTien97 deleted the fixStopDN branch October 10, 2026 11:20
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