Files
yoniebans 0391e62acc fix(cron): cron refuses a handle that does not serve the owner's store generation, as on main
- cron refuses and closes a handle that does not serve the owner's store generation, as on main

On main cron ran a job only on the owner's own store object: acquire(owner.db.db_path) had to return owner.db, so a handle opened after state.db was replaced (a new generation) was released and the run refused.

The stack opened a second handle and asked only owner.persistence.ready(), which answers from the owner's held holder, so after a replacement the job wrote into the new file while its accepted-work record stayed in the old one.

Cron now asks owner.persistence.serves_same_store(store) and refuses, closing the new handle, when the two serve different generations or the owner's handle fails. The refusal tests split the old wrong-store row into a closed owner and another generation, and a real-store case replaces state.db under a real owner handle (refused) beside an unreplaced control (served).

Depends on Persistence.serves_same_store, the interface addition in the root's F24 interface and sqlite-backend patches (protocol and reference at interface; SQLiteStore holder identity and the Persistence forward at sqlite-backend). Proof with those applied: 14 passed (cron 10, contract 2, sqlite 2); with this cron change reverted the replaced case and both refusal rows fail; with SQLite's comparison reduced to a type check the replaced case fails. At this level alone the unreplaced control fails (the handle has no serves_same_store yet, so cron refuses), 9 passed and 1 failed, until the interface lands below.

- the cron owner stubs answer serves_same_store, the question cron now asks the owner's handle

Two cron test fixtures stub the owner's storage handle with ready(), which cron no longer calls to accept the owner's store; they answer serves_same_store instead. Test only.

Proof: with the root's F24 interface and sqlite-backend patches applied, the 19 cron files red at c1606d32eb (62 failed) give 223 passed, 0 failed; without those patches the 4 stub cases of these two files were the only reds left once the real-store cases are excluded.

Reported-by: greptile-apps
Reported-by: BearHuddleston
Reported-by: unsupportedpastels
0391e62acc · 2026-11-17 19:10:42 +01:00
History
..
…
…