coder999o opened a new issue, #6493:
URL: https://github.com/apache/rocketmq-dashboard/issues/6493

   ## Description
   
   `NotificationOutboxService.dispatch()` reads a batch before claiming each 
delivery. The claim validates current status, due time and lease eligibility, 
but it does not verify that the selected retry count is still current.
   
   ## Reproduction
   
   With two Studio replicas sharing the outbox:
   
   1. Worker A selects a due row with `attempt_count=3` and pauses before 
claiming it.
   2. Worker B fails its fourth attempt, storing `RETRY_WAIT`, count 4 and its 
backoff.
   3. Once that retry is due again, A resumes and successfully claims the row 
with a new token.
   4. A's failure increments its old snapshot from 3 to 4 and writes 
`RETRY_WAIT/4`, although this was the fifth failure and should be terminal 
`FAILED/5`.
   
   A still owns its new claim, so the existing token fence permits this stale 
failure accounting. An older snapshot can also decrease the stored counter and 
shorten the retry backoff.
   
   ## Expected behavior
   
   Claiming a delivery must reject a selected snapshot whose retry count has 
changed. A later poll can read the current row and apply the normal retry 
budget and backoff.
   
   ## Verification
   
   Reproduced on `rocketmq-studio` at `779b8c0e` with the real MyBatis mapper 
and an H2 database in MySQL mode. A one-shot selection hook advances the 
database count after reading the batch; the stale dispatch then overwrites the 
newer failure information. The regression fails on the unmodified 
implementation, while the fresh/expired lease regression passes.
   
   Command: `mvn -B -ntp -f server/pom.xml -Dspring.profiles.active=dev 
-Dtest='NotificationOutboxMapperIntegrationTest#staleDispatchCannotOverwriteTheRetryCountTest+dispatchClaimStillHonorsFreshAndExpiredLeasesTest'
 test` (2 run, 1 expected failure, 0 errors).
   
   This is a deterministic database interleaving with a simulated email 
failure, not a live SMTP or two-process deployment test.
   


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