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

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported race condition in `ServiceThread#wakeup()` / `waitForRunning()` 
has been verified against the current codebase 
(`common/src/main/java/org/apache/rocketmq/common/ServiceThread.java`).
   
   **Root Cause:** Between the fast-path CAS failure 
(`hasNotified.compareAndSet(true, false)` returns false) and 
`waitPoint.reset()` in `waitForRunning()`, a concurrent `wakeup()` call can 
successfully `countDown()` the latch — but `reset()` immediately restores the 
count to 1, discarding the notification. The worker thread then blocks on 
`await(interval)` for the full interval (default 1000ms).
   
   **Impact:** Any `ServiceThread` subclass (e.g. `FlushRealTimeService`, 
`ReputMessageService`, `HAService`) may experience delayed wakeups under 
concurrent `wakeup()` calls, increasing message flush/replication latency.
   
   **Severity:** High — affects core message reliability path.
   
   An automated fix proposal will 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