Skip to content

fix(jobs): judge refresh cleanup against the unrestricted key_source (2.3) - #1597

Open
dimitri-yatsenko wants to merge 1 commit into
maint/2.3from
fix/jobs-refresh-restriction-2.3
Open

dimitri-yatsenko wants to merge 1 commit into
maint/2.3from
fix/jobs-refresh-restriction-2.3

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

Cherry-pick of #1595 onto maint/2.3 for the v2.3.5 patch release.

Closes #1594 on the 2.3 line. The commit applies cleanly to v2.3.4; see #1595 for the description.

`Job.refresh(*restrictions)` narrowed key_source to add jobs and then
reused the narrowed key_source in its cleanup step. Every job older than
stale_timeout whose key fell outside the restriction therefore looked
vanished and was deleted, including jobs reserved by other workers and
error records. `populate(*restrictions, reserve_jobs=True)` calls
refresh this way. Cleanup now checks keys against the unrestricted
key_source; the restrictions still limit which jobs are added and
re-pended.

Success and error records whose key has left both key_source and the
target (because the upstream row was deleted) are now removed on every
refresh, whatever their age, instead of lingering until stale_timeout.
Records of rows that still exist are kept. The age-based check for the
other statuses, and stale_timeout=0 skipping it, are unchanged.

Cleanup now issues one DELETE per step instead of an existence query
and a DELETE for each key.

Refs #1577

(cherry picked from commit fc12194ed9e13988f82b09a397b3c3373b244853)
@dimitri-yatsenko dimitri-yatsenko added this to the v2.3.5 milestone Oct 17, 2026
@dimitri-yatsenko dimitri-yatsenko added the bug Indicates an unexpected problem or unintended behavior label Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant