Commit 4a275fb
authored
Persist deduplicated message positions so they are always cleared (#176)
When ProcessMessages drops a message as a duplicate (by idempotency key),
stage its position into _deliveredPositions and persist it to the
DeliveredPositionsId effect immediately, rather than relying on an
immediate per-position store delete.
Previously the dedup branch added the position to the in-memory set only
when piggybacking on a real delivery's effect upsert. If no delivery
followed (all-duplicate batch, no matching subscription, or the flow
suspended/completed first) the position was never written to the effect,
so AfterFlush never cleared it from the store and a crash could not
replay it. Persisting at stage time routes dedup cleanup through the same
batched, crash-safe drain path as real deliveries. The write is taken
under _lock to match the DeliverMessages access.1 parent 34e5e3f commit 4a275fb
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
0 commit comments