Commit ad810db
Keep one bad custom list from wedging the entries sweep (PP-4506)
A custom list whose auto_update_query contained an invalid `published`
value (e.g. `2025>01>01`) failed its per-list task and, because that task
is a chord header, stopped the chord body from ever running. The body is
what releases the sweep-level Redis lock, so the lock stayed held for its
full 2-hour TTL while the sweep is scheduled hourly -- one malformed list
silently blocked custom list updates for every library, every sweep.
Two fixes:
* update_custom_list_entries now catches QueryParseException alongside
RequestError. Both mean "this list's query is malformed", but they are
raised from different layers: RequestError is an OpenSearch 400, while
QueryParseException comes from our own JSONQuery parser before any
request is sent. Catching only the latter let the former abort the
sweep. This restores the behavior of the CustomListUpdateEntriesScript
this pipeline replaced, which logged and skipped a bad list.
* finalize_custom_list_entries_sweep is now registered as the chord body's
error callback as well as its body, so the sweep lock is released even
when a per-list task fails. Infrastructure errors (database down,
OpenSearch transport failure) are still deliberately allowed to
propagate and alarm -- they just no longer strand the lock too.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent ea07c6e commit ad810db
2 files changed
Lines changed: 133 additions & 17 deletions
File tree
- src/palace/manager/celery/tasks
- tests/manager/celery/tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
| |||
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
142 | 156 | | |
143 | 157 | | |
144 | | - | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
| |||
350 | 364 | | |
351 | 365 | | |
352 | 366 | | |
353 | | - | |
| 367 | + | |
354 | 368 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
359 | 380 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
365 | 384 | | |
366 | 385 | | |
367 | 386 | | |
| |||
390 | 409 | | |
391 | 410 | | |
392 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
393 | 416 | | |
394 | 417 | | |
395 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
| |||
124 | 144 | | |
125 | 145 | | |
126 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 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 | + | |
127 | 202 | | |
128 | 203 | | |
129 | 204 | | |
| |||
399 | 474 | | |
400 | 475 | | |
401 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
402 | 492 | | |
403 | 493 | | |
| 494 | + | |
404 | 495 | | |
405 | 496 | | |
406 | 497 | | |
407 | 498 | | |
408 | 499 | | |
409 | | - | |
| 500 | + | |
410 | 501 | | |
411 | 502 | | |
412 | 503 | | |
413 | 504 | | |
414 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
415 | 510 | | |
416 | 511 | | |
417 | 512 | | |
418 | 513 | | |
419 | 514 | | |
420 | 515 | | |
421 | | - | |
422 | | - | |
423 | | - | |
| 516 | + | |
424 | 517 | | |
425 | 518 | | |
426 | 519 | | |
| |||
0 commit comments