Commit c6d3a68
committed
fix(sqs/throttle): drop dead sweep state + add throttle idempotency test (PR #679 round 2)
Two items from the round-2 Claude review on PR #679:
(1) bucketStore.sweepMu and bucketStore.lastSweep became dead code
when the move from on-hot-path maybeSweep to the background
runSweepLoop landed in round 1. The sweep() ticker is the only
caller, so the serialisation primitive that protected against
concurrent on-hot-path callers no longer has a job. Removed both
fields and the sweepMu.Lock/lastSweep=now/sweepMu.Unlock block;
sweep() now reads b.clock() inline. Field comment updated to
describe the post-runSweepLoop design (single-goroutine driver).
(2) TestSQSServer_CatalogCreateIsIdempotent now exercises
throttleConfigEqual via a fourth case: same name, same
VisibilityTimeout, but the second create adds Throttle* attributes.
attributesEqual must notice the diff and the call must reject as
QueueNameExists. Without this case a future bug in
throttleConfigEqual (e.g. always returning true) would slip past
the existing VisibilityTimeout-only test.
Both findings noted in the round-2 Claude review on PR #679.1 parent e3530e9 commit c6d3a68
2 files changed
Lines changed: 35 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
139 | 162 | | |
140 | 163 | | |
141 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 113 | + | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
305 | 303 | | |
306 | 304 | | |
307 | 305 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
312 | 311 | | |
313 | 312 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 313 | + | |
319 | 314 | | |
320 | 315 | | |
321 | 316 | | |
| |||
0 commit comments