Commit f38de3a
committed
LEGLINK-186: Stop stamping a retry due-time on dead-lettered records
The backoff timestamp is a due-time the -Retry listener waits on, so it is
a promise that the record will be delivered again. It was stamped before
the routing decision was known, so every dead letter carried one - a
delivery that was never scheduled. Poison landed on -Error advertising a
retry ~20s in the future that nothing would ever perform.
Stamping is now split by what each header means:
attempts history - how many times the record ran. Stamped
unconditionally, survives onto the dead letter.
backoff-timestamp a promise - stamped only when the decision is RETRY.
The remove() before the conditional is load-bearing. An exhausted record
arrives carrying the due-time from its previous retry hop, so declining to
stamp a new one is not enough; the stale one has to be cleared or it rides
onto the DLT looking current.
No routing or timing change: the due-time is computed identically for the
RETRY case, and the other three decisions never used it.
Nothing reads these headers off -Error today - the DLT listener was
suppressed earlier in this branch - which is why this was invisible. It
matters for the dead-letter replay capability we want: replay tooling
reading -Error would otherwise find attempts=1 and a pending due-time on
records that are finished.
Renamed RetryTopicRecovererLoggingTest -> RetryTopicRecovererDecisionTest;
it now covers the topic, the log line and the headers, i.e. everything
derived from the Decision. Five header tests added, three of which failed
before this change. The two that already passed guard the other direction:
a retried record must still carry a future due-time, and a dead letter must
still record its attempt count.
Tests: shared 12, measureeval 130, validation 153, 0 failures.
Verified live on a rebuilt image, EvaluationRequested ladder:
18:26:54.091 Retry attempt 1/4 [EvaluationRequested]
18:27:14.095 Retry attempt 2/4 [EvaluationRequested-Retry] +20.004s
18:28:14.098 Retry attempt 3/4 [EvaluationRequested-Retry] +60.003s
18:30:14.101 Max retry attempts (4) reached. Routing to DLT +120.003s
Every interval within 4ms of PT20S/PT60S/PT120S, matching the runs from
before this change. That final hop is the case this fix targets: the record
had genuinely retried three times, so it arrived carrying the due-time its
previous hop stamped, and that stale value had to be cleared rather than
merely not re-stamped.
Claude-Session: https://claude.ai/code/session_01AZubeEYCKfAmDCcgVTr18G1 parent 62857e1 commit f38de3a
2 files changed
Lines changed: 102 additions & 16 deletions
File tree
- Java
- measureeval/src/test/java/com/lantanagroup/link/measureeval/configs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | | - | |
44 | | - | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
73 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
| |||
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
119 | | - | |
| 129 | + | |
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
| |||
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
166 | 241 | | |
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
0 commit comments