Repository navigation
Commit c64f100
committed
fix(jobs): stale_timeout=0 means no grace period
refresh() removes a job whose key has left key_source once the job is
older than stale_timeout, a grace period for a key_source that is still
being filled. stale_timeout=0 skipped that check instead, so there was no
way to ask for the cleanup now: refresh(stale_timeout=0) left every such
job in place, and so did populate() with config.jobs.stale_timeout = 0.
0 now means no grace period: on that refresh, every job whose key is no
longer in key_source is removed, whatever its age, unless it is marked
ignore. That includes reserved jobs, and success records of rows that
remain after their key left key_source, which a nonzero stale_timeout
keeps for that many seconds. stale_timeout=None still means the
configured value (config.jobs.stale_timeout, 3600 seconds by default), so
a refresh that does not pass it keeps the grace period. The setting's
description, "Seconds before pending job is checked for staleness", now
describes the grace period and what 0 does.
Skipping the check is no longer expressible as 0; a long stale_timeout
keeps such jobs for as long as it says.
The tests delete upstream rows and check, on MySQL and PostgreSQL, that a
default refresh keeps the pending jobs of the deleted keys, that
refresh(stale_timeout=0) removes them, and that populate() with
config.jobs.stale_timeout = 0 removes them instead of trying to compute
them. Each fails without the change. They replace the test that held 0 to
its old meaning.
Closes #1577.1 parent 6a1e171 commit c64f100
3 files changed
Lines changed: 42 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
| |||
363 | 362 | | |
364 | 363 | | |
365 | 364 | | |
366 | | - | |
| 365 | + | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
437 | 440 | | |
438 | 441 | | |
439 | | - | |
440 | | - | |
| 442 | + | |
| 443 | + | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
171 | 189 | | |
172 | 190 | | |
173 | 191 | | |
| 192 | + | |
174 | 193 | | |
175 | | - | |
176 | 194 | | |
177 | | - | |
178 | | - | |
| 195 | + | |
| 196 | + | |
179 | 197 | | |
180 | | - | |
181 | | - | |
| 198 | + | |
182 | 199 | | |
183 | 200 | | |
184 | 201 | | |
| |||
0 commit comments