Skip to content

--install has no inter-process lock: the settings.json merge, the bin copies and the receipt all read/merge/replace unserialized #106

Description

@brettheap

openRepoTools --install has no inter-process lock anywhere: two simultaneous runs for one account race on every file it writes. The shape is the same read/merge/replace at three sites, and two of them predate PR #103:

Copilot named the third on PR #103 (thread #103 (comment)): two installs with different OPENREPOTOOLS_BIN_DIR values can both read the receipt and the last mv discards the other's rows. That is real and it is narrower than the file's own rule already makes it — the receipt is EVIDENCE with a fallback (the header marker still identifies an installer copy, and a row that is missing means "fallback", never "remove"), so a lost row costs a retirement its stronger evidence, not a file. A lock added to the receipt alone would leave the two older sites racing and would be the one lock in a command that otherwise has none, which is why PR #103 declined to add it there and files the whole shape here instead (take what a round introduced; file what predates it).

What this wants, if anything: ONE lock around the whole of --install (a mkdir lock beside the bin directory or under $XDG_RUNTIME_DIR, since flock is not on macOS — lanes-edit.sh already carries the portable idiom), taken before the plan and released on exit, with a case in tests/test_openrepotools_command.py that a held lock is waited on and then named rather than raced past. Or a ruling that two simultaneous installs for one account are not a supported use and the command says so. Not urgent: nothing on Eagle or Raven runs the installer twice at once; the container entrypoint (workBenches#99) runs it once per start under its own flock.

Filed by lane openRepoTools-1 from PR #103's review.

No activity

Activity on this issue will appear here.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions