youngkermit8-coder opened a new pull request, #7036: URL: https://github.com/apache/rocketmq-dashboard/pull/7036
### Which Issue(s) This PR Fixes - Fixes #6964 ### Brief Description Prevent queued SMTP, DingTalk and SMS delivery from starting when the existing heartbeat has already confirmed claim loss during preparation. Recheck immediately before the external sender/client call, and distinguish a skipped send from successful external completion. Explicit test notifications, genuine failure retries, in-flight sends and token-guarded bookkeeping keep their existing behavior. Three files only: the notification service, one regression class and the existing design document. No API, schema, dependency, executor/lease policy or unrelated candidate changes. Credit #2670 (@tju-yxq) for the existing heartbeat/token/bookkeeping safeguards. This extends the pre-send preparation boundary rather than reposting that implementation. This draft is available for design review; it does **not** promise atomic database-to-network fencing or exactly-once delivery. A claim can change after the check and already-started sends may complete; receivers still need deduplication. ### How Did You Test This Change? - On unchanged baseline `c34535db`: `mvn -o -B -ntp -Dtest=NotificationSendAdmissionTest test` — 20 executions, 10 expected assertion failures (send started after known loss), 10 healthy-renewal controls, 0 errors/skips. - Fixed: `mvn -o -B -ntp -Dtest=NotificationSendAdmissionTest,NotificationOutboxServiceTest,NotificationWebhookEncodingTest,AlertNotificationSuppressionServiceTest,AlertNotificationTemplateTest test` — 5 suites / 79 executions passed. The 20 new cases also passed two further independent runs. - Independent Linux Java 21, dedicated disposable MySQL with the unchanged schema: unfiltered `mvn -o -B -ntp test` — **305 suites / 3,755 executions, 0 failures/errors/skips**. Tests ran with the existing Mockito javaagent and a read-only local Maven cache; no tests/security checks were excluded. - Normal subsequent `mvn -o -B -ntp -DskipTests package` — passed, including Checkstyle (0 violations) and the unchanged 278-component material gate (3 pre-existing warnings retained, not legal approval). - Exact 1,658-file source tree checked against LF archive/Git objects; changed class matches the packaged class and test/JDBC payloads remain excluded. `git diff --check` passed. Temporary test DB/network removed; no operator DB used. The regression runs real dispatch workers and the registered heartbeat callback with latches. Timer, persistence and SMTP/HTTP boundaries are controlled substitutes: this is not a live receiver/JDBC-loss or production-frequency claim. The checks narrow admission after **known** loss, not the race after the final check. AI assistance was used for investigation, implementation and verification. Frontend/Go are not changed; those suites were not rerun as part of this standalone backend run. Official PR CI remains separate. ICLA status is not asserted here. ### Checklist - [x] One coherent change, Conventional Commits subject - [x] Regression tests named `...Test`, ASF headers on new source - [x] Documentation updated and backend architecture constraints passed - [x] No UI text, API/schema/dependency or unrelated changes - [ ] Maintainer design review / official CI / any required contributor-license confirmation -- 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]
