RockteMQ-AI commented on issue #11013:
URL: https://github.com/apache/rocketmq/issues/11013#issuecomment-5538919368

   ### Issue Evaluation
   
   **Category:** `type/bug` | **Status:** Confirmed
   
   The reported issue has been verified against the current codebase (`develop` 
branch).
   
   **Root Cause:** In `MessageRocksDBStorage`, the `ScheduledExecutorService 
scheduler` (line 86) registers a periodic `flushTimerWal` task in `postLoad()` 
(line 117). However, `preShutdown()` (line 144) does not cancel the scheduled 
task or shut down the scheduler. When `AbstractRocksDBStorage.reloadRocksdb()` 
(line 685) calls `shutdown()` followed by `start()`, each reload registers 
another periodic flush task on the same executor without removing the previous 
one.
   
   **Impact:**
   - Timer-WAL flush tasks accumulate with each reload, causing unnecessary 
resource consumption
   - Non-daemon scheduler threads remain alive after RocksDB resources are 
closed, potentially preventing clean JVM shutdown
   
   **Affected Components:** `store` module — `MessageRocksDBStorage`, 
`AbstractRocksDBStorage`
   
   **Severity:** Medium — resource leak that manifests under repeated reload 
scenarios
   
   **Suggested Fix:** Store the `ScheduledFuture` returned by 
`scheduleAtFixedRate()` and cancel it in `preShutdown()`. Alternatively, shut 
down and recreate the scheduler in the `shutdown()`/`start()` lifecycle.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


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