Commit ac3e128
committed
fix(adapter/sqs): PR #923 round-2 — re-validate batch entries against current meta every attempt
codex P2 round-2: round-1 moved per-entry validation into the first-mint path,
so an entry whose identity was minted by a prior UNCOMMITTED attempt (lost a
normal OCC race) skipped validation on retry. If a concurrent SetQueueAttributes
lowered MaximumMessageSize (or tightened another meta-dependent limit) in the
meantime, the retry could commit a message the fresh meta should reject.
Split the two concerns:
- validateBatchEntry runs against the CURRENT meta on EVERY attempt (body
required, MaximumMessageSize, attributes, FIFO params, delay bounds) and
returns the resolved delay.
- The stable identity (MessageID/token/timestamps incl. AvailableAtMillis) is
still minted ONCE and reused, so the keys stay stable across retries (round-1
vis-key stability preserved); AvailableAtMillis is seeded from the first
attempt's delay, and re-resolving delay per attempt only re-checks bounds.
Caller audit: validateBatchEntry has one caller (buildBatchSendRecord);
buildBatchSendRecord has one caller (sendBatchStandardOnce); mintBatchSendIdentity
removed (no refs). Single-send/FIFO paths unaffected (buildSendRecord unchanged).
Test: TestSendMessageBatchStandard_RevalidatesAgainstCurrentMetaOnRetry — a
mid-flight MaximumMessageSize drop must make the retry reject the now-too-big
entry.1 parent 8770f13 commit ac3e128
2 files changed
Lines changed: 74 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
120 | 156 | | |
121 | 157 | | |
122 | 158 | | |
| |||
125 | 161 | | |
126 | 162 | | |
127 | 163 | | |
128 | | - | |
| 164 | + | |
129 | 165 | | |
130 | 166 | | |
131 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
419 | 424 | | |
420 | 425 | | |
421 | 426 | | |
| |||
424 | 429 | | |
425 | 430 | | |
426 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
427 | 436 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
435 | 443 | | |
436 | 444 | | |
437 | 445 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
443 | 454 | | |
444 | | - | |
| 455 | + | |
445 | 456 | | |
446 | 457 | | |
447 | | - | |
| 458 | + | |
448 | 459 | | |
449 | 460 | | |
450 | | - | |
| 461 | + | |
451 | 462 | | |
452 | 463 | | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 464 | + | |
458 | 465 | | |
459 | | - | |
| 466 | + | |
460 | 467 | | |
461 | 468 | | |
462 | 469 | | |
| |||
0 commit comments