Startup grace holds preassigned executions of any worker ever refused secrets, and logs nothing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, distributed-systems
Research direction
Start with server/orcaster_server/housekeeping.py:255-279 and inspect the grace branch in _run_once at server/orcaster_server/housekeeping.py:544-551. Check how polling updates refusal and heartbeat timestamps in server/orcaster_server/api/poll.py, then review the existing housekeeping tests and changelog. Done when the grace predicate excludes old refusal marks and deleted workers, the warning reports the held count only when nonzero, the specified tests pass, and an Unreleased note documents earlier expiry after restart.
Written by the indexing model from the issue text.
Description
Problem
Housekeeping expires overdue assigned executions (server/orcaster_server/housekeeping.py:255-279). It skips an execution whose task declares task_env and whose worker was refused secret delivery recently, because that worker is still asking for the task.
During the startup grace, the age of the refusal mark is ignored: any non-NULL workers.task_secrets_refused_at is enough (server/orcaster_server/housekeeping.py:270-271). This is meant for the case "configure the keys file and restart", where the mark aged while the server was down.
Two problems:
- The shield is too wide. The mark is only written by a refused poll (
server/orcaster_server/api/poll.py:986-989) and nothing ever resets it to NULL. So during every grace, the shield covers every worker that was refused once, even long ago. The join onworkersalso has nodeleted_atfilter, so a soft-deleted worker that still ownsassignedrows is covered too. A soft delete without?force=truedoes not cancel the worker's executions (server/orcaster_server/api/admin_workers.py:346). The cost is bounded: expiry is delayed by at most one grace (STARTUP_GRACE_SECONDS,server/orcaster_server/config.py:146) plus one housekeeping interval. No data is lost. - No signal. The lease shield logs a WARNING with a count during grace (
server/orcaster_server/housekeeping.py:544-551). This shield logs nothing. The operator cannot tell from the log whether the protection engaged after a restart.
Proposed change
- Bound the grace branch by the worker's own last poll. A refused poll also updates
last_heartbeat_at(server/orcaster_server/api/poll.py:92), and server downtime freezes it. In grace, requirew.task_secrets_refused_at >= w.last_heartbeat_at - interval '120 seconds', plusw.deleted_at IS NULL:- a worker refused at its last poll keeps the shield, however long the server was down;
- a worker that polled normally after its last refusal does not;
- a soft-deleted worker does not.
- In the grace branch of
_run_once, count (read-only, same predicate) the overdue preassigned executions that the shield holds. If the count is above zero, log one WARNING, for examplehousekeeping: startup grace holding N overdue preassigned execution(s) of workers refused task secrets; they expire after the grace unless the worker polls. Log nothing when the count is zero. - Keep
STARTUP_GRACE_SECONDS, its default and the non-grace predicate unchanged.
Compatibility
No migration, no API change and no setting change. Existing deployments see one behavior change: after a restart, a preassigned execution of a worker that was refused long ago, or of a soft-deleted worker, now expires in the first housekeeping pass instead of after the grace. The task follows the normal expiry path it would follow anyway a few minutes later. Workers refused at their last poll keep the current protection. The release note states this.
Acceptance criteria
- Test (
in_grace=True): a worker whose mark is much older than itslast_heartbeat_atdoes not shield its overdue preassigned execution. - Test (
in_grace=True): a worker whose mark is within 120 s of its frozenlast_heartbeat_atstill shields the execution, whatever the age of both timestamps. - Test (
in_grace=True): a soft-deleted worker does not shield its execution. - Test: outside grace, behavior is unchanged.
- Test with
caplog: a grace pass that holds N > 0 executions logs one WARNING with N, and a pass that holds none logs nothing. - Existing deployments keep working without config changes.
STARTUP_GRACE_SECONDSand its default are unchanged. - CHANGELOG entry under Unreleased, with the note that some held executions may expire earlier after a restart.
Open questions
- Does any path other than the poll (for example worker registration) write
last_heartbeat_atin a way that breaks the bound in step 1?
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
[Resource]: SpaicelyOpenresource-submission validation-passed
Difficulty 1/5 Under an hour Newbie friendliness 68/100
hesreallyhim/awesome-claude-code#3875 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bvis/aegis-hass#725 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xPossibly taken @NimaVaziri claimed this today. OpenPytorch
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainers usually reply within 1 day