Skip to content

RMW state locks can be stolen from live owners or retry indefinitely #406

Open

Description

@DivyamTalwar

Problem

The local read-modify-write lock reclaims an existing marker solely because its wait deadline expires. A still-running writer can therefore lose exclusivity, and a non-removable marker can cause an unbounded retry loop.

Reproduction

On unmodified ce30de7ca94115cb73fa991538c6d2595ac2622a, hold a per-project RMW marker past the two-second acquisition deadline. The competing call enters the critical section even when the first owner is still alive. Make the stale marker non-removable and the retry path can continue beyond its deadline. The retained regression tests reproduce both conditions with isolated filesystem fixtures.

Intended correction

Record a PID and unique ownership token, bound stale recovery, and reclaim only an unchanged marker whose owner is demonstrably gone. Unknown, malformed, legacy PID-less and permission-denied owners fail closed. Release removes only the marker still owned by that acquisition.

This concerns the local state RMW lock, not the distributed skill-publishing problem in #340.

Activity

  1. DivyamTalwar commented on Sep 22, 2026

    @DivyamTalwar
    Author

    I’m picking this up because losing local RMW exclusivity can corrupt state, while retrying forever can hang the worker. I reproduced both paths and prepared a focused ownership-aware, bounded-recovery fix with negative controls and regression tests. This does not attempt distributed locking.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions