LostSnowfluff opened a new pull request, #11014:
URL: https://github.com/apache/rocketmq/pull/11014
<!-- Please make sure the target branch is right. In most case, the target
branch should be `develop`. -->
### Which Issue(s) This PR Fixes
- Fixes #11013
### Brief Description
`MessageRocksDBStorage` registered a periodic timer-WAL flush task but did
not cancel it or shut down its scheduler during storage shutdown. Because the
RocksDB reload path calls `shutdown()` followed by `start()`, each reload added
another periodic flush task to the same executor.
This PR:
- tracks the scheduled task as part of the storage load lifecycle;
- cancels the task and shuts down the scheduler before RocksDB resources are
closed;
- creates a fresh scheduler on each successful start, preventing task
accumulation after reload;
- serializes the timer-WAL flush and checks the storage lifecycle before
accessing RocksDB.
### How Did You Test This Change?
`MessageRocksDBStorageLifecycleTest` verifies after each shutdown that the
previous scheduler is shut down and its queue is empty, then verifies after
each start that the scheduler is a new instance with exactly one periodic task.
--
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]