Commit 4bdd70d
fix(redis-worker): make per-env pop-failure increment idempotent
Multiple workers can race past pickNextEnv into the same env before
skip propagates from the first failing pop. With the prior unguarded
`failed += 1` each racing worker bumped the count, so a single broken
env could contribute up to `concurrency` failures in one tick — drifting
from the documented "one failure per env batch" contract.
Guard the increment on `!skip.has(envId)` so the per-env failure count
is exactly one regardless of race. Tightens the test assertion from
"in [1, concurrency]" to "=== 1".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 1c6fc45 commit 4bdd70d
2 files changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
196 | 203 | | |
197 | | - | |
198 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
| |||
0 commit comments