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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to