events: cleanup restores an orphaned lease row, and can write an old baseline over a later run's value
#205
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the module-rust phase 12 walk. Recorded in
docs/modules/rust/PLAN.md§27.6.What happens
claimRevert(server/src/model/events/eventRunResources.db.js) movespending | confirmed | orphaned | driftedrows toreverting. For an action's resource, reverting something that is already gone is harmless, becauserevert()of an absent thing succeeds. For a lease, anorphanedrow means the module said "this hold is no longer in force". A laterrestore()on it is then a write of that run's old baseline over whatever the world holds now.Reproduction (Oxide rig,
rust.group.permission)held: falseand marks run 2's roworphaned. Run 2 is cancelled.revertingand collides with run 3's live row onuq_evres_target. It failed on every sweep (13 times).restore()then goes through and revokes it.A lease's compare-and-set cannot catch this when the later holder applied the same value.
Suggested direction (not decided)
An
orphanedrow whose action iscore.lease(reversible: 'override') should be terminal for cleanup, likereverted: nobody holds it, so there is nothing to put back. At minimum, it should not be claimable while another row holds the same target.