Skip to content

Parallel releases race in the shared ruby-advisory-db: bundle:audit:update fails with 'cannot lock ref' #57

Closed

Description

@pboling

Observed (family release of 11 members in parallel, kettle-family 1.3.41): `bin/rake` default task step failed in one member:

```
Updating ruby-advisory-db ...
failed to update "~/.local/share/ruby-advisory-db"
error: cannot lock ref 'refs/remotes/origin/master': is at 305f8b0… but expected 4d71b12…
```

The default task registers `bundle:audit:update` (`rakelib/bundle_audit.rake`), which does a `git pull` in one directory shared by every member. Concurrent pulls collide on the ref lock. The database also moved (`4d71b12..305f8b0`) during the run, so several members updated it at once.

Wanted

  1. Serialize the update across processes (an `flock` on a lock file next to the database), so concurrent members wait instead of failing.
  2. An env switch that skips only the update (for example `KETTLE_DEV_SKIP_AUDIT_UPDATE=true`) while still running `bundle:audit`, so a coordinator such as kettle-family can update once and tell members not to. Today the only knob (`skip_bundle_audit`) disables the audit entirely.
  3. A failed update should not fail the whole release when a usable local database exists (warn, then audit with the existing copy).

Tracking: part of the galtzo-floss family release failures (kettle-family issue to follow).

Activity

  1. pboling commented on Nov 14, 2026

    @pboling
    MemberAuthor

    Progress: PR #58 implements the flock, KETTLE_DEV_SKIP_AUDIT_UPDATE, and non-fatal failed update (specs + full suite green). Bundler re-install race tracked in #59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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