{"record":{"id":"658b8c319c15c2b1","repo":"phacility/phabricator","slug":"another-process-is-currently-discovering-repositor","errorCode":null,"errorMessage":"Another process is currently discovering repository \"%s\", skipping discovery.","messagePattern":"Another process is currently discovering repository \"(.+?)\", skipping discovery\\.","errorType":"exception","errorClass":"DiffusionDaemonLockException","httpStatus":null,"severity":"warning","filePath":"src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php","lineNumber":45,"sourceCode":"\n\n  public function getRepairMode() {\n    return $this->repairMode;\n  }\n\n\n  /**\n   * @task discovery\n   */\n  public function discoverCommits() {\n    $repository = $this->getRepository();\n\n    $lock = $this->newRepositoryLock($repository, 'repo.look', false);\n\n    try {\n      $lock->lock();\n    } catch (PhutilLockException $ex) {\n      throw new DiffusionDaemonLockException(\n        pht(\n          'Another process is currently discovering repository \"%s\", '.\n          'skipping discovery.',\n          $repository->getDisplayName()));\n    }\n\n    try {\n      $result = $this->discoverCommitsWithLock();\n    } catch (Exception $ex) {\n      $lock->unlock();\n      throw $ex;\n    }\n\n    $lock->unlock();\n\n    return $result;\n  }\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Do nothing if it only appears in daemon logs with no other symptoms; the daemon retries discovery on the next cycle","Check for a concurrent process: 'phd status' and look for a manual bin/repository command still running","If no process holds it but the error persists, restart daemons with 'phd restart' so stale locks are released","In clusters, verify only the intended devices discover the repository (Almanac service bindings)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  id(new PhabricatorRepositoryDiscoveryEngine())\n    ->setRepository($repository)\n    ->discoverCommits();\n} catch (DiffusionDaemonLockException $ex) {\n  // another process holds repo.look; skip this round and retry later\n  phlog($ex->getMessage());\n  return;\n}","preventionTips":["Do not run manual 'bin/repository discover' while daemons are active; pause the repository first","Keep exactly one discovery source per repository in cluster configurations","Treat lock skips in daemon logs as noise unless discovery makes no progress across many cycles"],"tags":["phabricator","repository","discovery","lock","daemon"],"backgroundTag":"lock-contention","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}