Recovery skips orphaned retrying deliveries whose target type changed to a non-retry type #82
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Low-severity edge case surfaced by the independent review of PR #81 (delivery Target-interface refactor).
Background
After #81, restart recovery and the 60s sweep look each orphaned
retryingdelivery's target up in the registry and only reschedule it if the target implements the internalrescheduler(i.e.http/slack). Fire-and-forget targets (database/log) never set statusretrying, so under normal operation nothing is dropped — this is correct and was verified in review.The edge case
If a target's
typeis mutated in the DB from a retry type (http/slack) to a fire-and-forget type (or an unknown type) while it still has an orphanedretryingdelivery, that delivery now stays stuck inretryingforever. The pre-refactor code would eventually re-dispatch it and let the new target type resolve it todelivered/failed.This requires editing a target's type out from under an in-flight retrying delivery, so it does not arise in normal operation, and neither the old nor the new code handles it "correctly" (old: re-dispatches under a type that never produced the retry; new: leaves it stuck). Noted for completeness; it was explicitly not a merge blocker.
Definition of done
Decide the intended behaviour for a
retryingdelivery whose target type no longer supports retries, and make recovery/sweep do that deterministically. Options:failed(with a recorded reason) during recovery, orPick one, implement it, and add a recovery test that seeds a
retryingdelivery whose target type has changed and asserts the chosen outcome.