Skip to content

Pre-existing: background reconcile leaves ledger edges open, scheduler cron errors not ValueError, watch clear/evaluate race #3943

Description

@mabry1985

Pre-existing issues flagged by the QA panel on #3939 (not introduced there):

  1. reconcile_interrupted leaves delegation ledger edges unsettled — background/store.py (~437) marks jobs interrupted on process restart without going through mark_complete, so the delegation ledger (STATE.ledger_store) keeps open edges for jobs that will never finish (org chart / delegation views show them as running forever). Settle the ledger edge when reconciling.
  2. Scheduler add_job/update_job can raise non-ValueError for malformed cron — scheduler/interface.py (~94) documents ValueError for bad schedules; some malformed cron strings raise other exceptions from the cron parser, which callers (tools, REST) don't catch → 500 / tool crash. Normalise to ValueError with a clear message; test a few malformed inputs.
  3. Watch clear() vs evaluate() race can resurrect a cleared watch — graph/watches/controller.py (~69): clear() pops the per-watch lock without acquiring it, so an evaluate() that already read the watch can write it back after it was cleared. Take the lock in clear() (or tombstone) and test the interleaving.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-infoIssue is missing required sections — see CONTRIBUTING.md (silent issue gate).

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions