You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Caideyipi (via GitHub)" <gi...@apache.org> on 2026/09/23 02:08:48 UTC
[PR] Fix thread pool lifecycle leaks [iotdb]
Caideyipi opened a new pull request, #18703:
URL: https://github.com/apache/iotdb/pull/18703
## Description
This PR fixes several executor lifecycle leaks that can accumulate threads and thread-pool registrations during repeated RPC calls, metric reporter reloads, and DataRegion replacement or deletion.
### RPC-scoped executors
- Shut down the executor owned by `DataPartitionTableGenerator` when generation completes, including exceptional completion.
- Shut down the executor created by `getEarliestTimeslots()` in a `finally` block after all region tasks finish.
### Metric reporters
- Shut down the scheduled executors owned by `IoTDBSessionReporter` and `IoTDBInternalLocalReporter` when the reporters stop.
- This prevents hot reporter reloads from retaining cancelled scheduler threads.
### DataRegion lifecycle
- Add an explicit lifecycle method for the per-DataRegion mod-file upgrade executor.
- Invoke it when a region is marked deleted and when `StorageEngine` stops, shuts down, or resets.
- Use graceful shutdown so already submitted mod-file upgrade tasks can complete.
### Verification
- `mvn spotless:apply -pl iotdb-core/datanode,iotdb-core/metrics/interface`
- `mvn compile -pl iotdb-core/datanode,iotdb-core/metrics/interface -DskipTests`
- `git diff --check`
<hr>
This PR has:
- [x] been self-reviewed.
- [x] concurrent read
- [x] concurrent write
- [x] added comments or Javadocs where the lifecycle ownership is not obvious.
<hr>
##### Key changed/added classes (or packages if there are too many classes) in this PR
- `DataPartitionTableGenerator`
- `DataNodeInternalRPCServiceImpl`
- `IoTDBSessionReporter`
- `IoTDBInternalLocalReporter`
- `DataRegion`
- `StorageEngine`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix thread pool lifecycle leaks [iotdb]
Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18703:
URL: https://github.com/apache/iotdb/pull/18703
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org