phacility/phabricator · warning · DiffusionDaemonLockException

Another process is currently discovering repository "%s", sk

Error message

Another process is currently discovering repository "%s", skipping discovery.

What it means

Thrown by PhabricatorRepositoryDiscoveryEngine::discoverCommits() when it cannot acquire the per-repository repo.look lock (newRepositoryLock with 'repo.look'). Phabricator serializes discovery per repository; if another daemon or process already holds the lock, the engine throws DiffusionDaemonLockException so the caller skips this round instead of blocking. The daemon treats it as try-again-later, not as a hard failure.

Source

Thrown at src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:45


  public function getRepairMode() {
    return $this->repairMode;
  }


  /**
   * @task discovery
   */
  public function discoverCommits() {
    $repository = $this->getRepository();

    $lock = $this->newRepositoryLock($repository, 'repo.look', false);

    try {
      $lock->lock();
    } catch (PhutilLockException $ex) {
      throw new DiffusionDaemonLockException(
        pht(
          'Another process is currently discovering repository "%s", '.
          'skipping discovery.',
          $repository->getDisplayName()));
    }

    try {
      $result = $this->discoverCommitsWithLock();
    } catch (Exception $ex) {
      $lock->unlock();
      throw $ex;
    }

    $lock->unlock();

    return $result;
  }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Do nothing if it only appears in daemon logs with no other symptoms; the daemon retries discovery on the next cycle
  2. Check for a concurrent process: 'phd status' and look for a manual bin/repository command still running
  3. If no process holds it but the error persists, restart daemons with 'phd restart' so stale locks are released
  4. In clusters, verify only the intended devices discover the repository (Almanac service bindings)
Defensive patterns

Strategy: retry

Try / catch

try {
  id(new PhabricatorRepositoryDiscoveryEngine())
    ->setRepository($repository)
    ->discoverCommits();
} catch (DiffusionDaemonLockException $ex) {
  // another process holds repo.look; skip this round and retry later
  phlog($ex->getMessage());
  return;
}

Prevention

When it happens

Trigger: Running 'bin/repository discover <repo>' manually while the repository discovery daemon is mid-run; two overlapping daemon tasks for the same repository; a previously killed process that left the repo.look lock held; cluster setups where two devices discover the same repository.

Common situations: Admin manually runs discovery to debug missing commits while phd daemons are active; daemons restarted without clearing stale locks; scheduled jobs overlapping with the pull-plus-discovery pipeline on large repositories.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/658b8c319c15c2b1. Report an issue: GitHub.