Skip to content

Global reconciliation lock is reported as “PV update is already in progress” #308

Description

@munezaclovis

Summary

PV's UpdateLock is also the daemon's global lock for queued mutating reconciliation work. When reconciliation owns it, blocked commands still report:

PV update is already in progress; update lock is held at ~/.pv/run/update.lock

This makes a long reconciliation or readiness probe look like a stuck app update.

Verified incident behavior

A Project reconciliation held the lock from July 28 21:10:56 to 21:11:57 while Gateway readiness waited on unreachable public ports. During that minute, pv update --check would accurately detect a live kernel lock but misidentify its owner as an app update.

The lock was not held for a day. Once reconciliation ended:

  • the empty lock file remained on disk, as designed;
  • no process had it open;
  • pv update --check succeeded immediately.

Historical lock errors also continued appearing in pv status, making the wording more misleading.

Current code

The error is permanently update-specific: StateError::UpdateInProgress.

The daemon reconciliation queue acquires the same UpdateLock for mutating work: reconciliation.rs.

The lock implementation correctly uses an OS flock; the file's continued existence is not itself treated as ownership: update_lock.rs.

Expected behavior

The error should describe the actual concurrency condition without falsely claiming an app update owns the lock.

A minimal compatible fix may use neutral wording such as “another PV mutating operation is in progress.” Rich owner/operation metadata can be considered separately and is not required to fix the false statement.

Acceptance criteria

  • A reconciliation-owned lock is not reported as an app update.
  • App-update flows may retain update-specific wording when ownership is actually known.
  • The message clearly distinguishes a live OS lock from a stale on-disk lock file.
  • Existing mutual exclusion and lock lifetime behavior remain unchanged.
  • CLI, daemon job errors, snapshots, and JSON-visible errors use consistent terminology.
  • Add coverage for both app-update-owned and reconciliation-owned contention.
  • Keep operation-owner metadata out of scope unless required by the chosen design.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontrol-planeControl-plane architecturepriority-mediumP2 medium priorityqualityTesting, status, QA, scopeready-for-agentFully specified, ready for an AFK agentvalue-mediumMedium value

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions