Skip to content

fix(server): avoid duplicate reminders during slow delivery - #6006

Merged
SteKoe merged 2 commits into
codecentric:masterfrom
Aminark:fix/skip-in-flight-status-reminders
Nov 28, 2026
Merged

SteKoe merged 2 commits into
codecentric:masterfrom
Aminark:fix/skip-in-flight-status-reminders

Conversation

@Aminark

@Aminark Aminark commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

If a notification takes longer to deliver than the reminder check interval, the next tick can send the same reminder again. Its last delivery time is only updated when the delegate completes.

Track delivery per reminder so overlapping checks skip the pending notification while other instances remain eligible. A successful delivery starts the next reminder period. An error or cancellation makes the reminder eligible for retry.

The tests hold a delegate open across two checks and verify it is called once. They also cancel an in-flight delivery and verify that the next check retries it.

@Aminark
Aminark requested a review from a team as a code owner November 27, 2026 17:04
@SteKoe
SteKoe requested a lite review from Copilot November 27, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical cancellation race in RemindingNotifier can strand a claimed reminder with delivering permanently set to true, so the active issue must be fixed before approval.

1 open issue
What changed in this PR

This PR prevents duplicate reminder notifications when delivery remains in progress across reminder checks, while allowing failed or cancelled deliveries to be retried.

Changes:

  • Tracks in-flight delivery state for each reminder.
  • Advances the reminder period only after successful delivery completion.
  • Adds tests for overlapping deliveries and cancellation-based retries.
File Description
spring-boot-admin-server/​src/​test/​java/​de/​codecentric/​boot/​admin/​server/​notify/​RemindingNotifierTest.java Adds tests verifying duplicate reminders are skipped during slow delivery and cancelled deliveries are retried.
spring-boot-admin-server/​src/​main/​java/​de/​codecentric/​boot/​admin/​server/​notify/​RemindingNotifier.java Adds per-reminder in-flight delivery tracking and completion handling for successful, failed, and cancelled deliveries.

Review effort: Lite

Comment on lines 112 to 113
.filter((reminder) -> reminder.startIfDue(now, this.reminderPeriod))
.flatMap((reminder) -> Mono.defer(() -> this.delegate.notify(reminder.getEvent()))
@SteKoe
SteKoe enabled auto-merge (squash) November 28, 2026 09:30
@SteKoe
SteKoe merged commit e25326f into codecentric:master Nov 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants