Commit d72ddde
committed
fix(resync): publish off the reconcile pass's thread
A reconcile pass could not complete while resync publication was making no
progress. `install_live` and `deactivate` block on an acknowledgement from the
resync worker thread, and that same thread ran every publication — which takes
the shared catalog-authoring lock, re-resolves the catalog, and takes the
recipient's stream lock. So a publication that was slow, refused and retried, or
blocked on another process serialized the whole pass behind it, once per live
seat. That is the property that let a terminal-refusal loop deny reconcile
passes for two hours: the loop's only power was denying the pass that would have
ended it.
Publication now runs on its own thread. The worker captures a transition, hands
it off, and applies the outcome when it returns, so it stays the only writer of
carrier baselines and retry deadlines. One publication is outstanding per
subscription at a time; a queued publication is dropped when its subscription is
deactivated or removed by a refresh, so nothing is published to a seat the pass
has already decided receives no events. Re-observing the carrier after an
outcome is the single re-arm mechanism for both a retained refusal and a carrier
that moved on while the publication was outstanding.
This is the primary requirement from #431. Terminal-refusal classification is
separate and still wanted: it removes the CPU burn and the unbounded retry, but
it would leave this coupling intact for the next condition that starves pass
completion.
Refs #431
agent-identity: dev3.compoundingtech.st2.resync-lock.worker
agent-persona: worker
agent-supervisor: dev3.compoundingtech-lead
agent-tool: OMP
agent-tool-version: 18.1.2
agent-runtime: OMP 18.1.2
tooling-profile: dotfiles@75340551 parent 5b2ee7c commit d72ddde
3 files changed
Lines changed: 544 additions & 95 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
0 commit comments