Change lock in PullLocalDaemon to only lock on discovery
Summary: The locks held by read-only pullLocal daemons were causing our discovery instance to not get the lock and fail at discovery. We don't need to hold the lock while pulling (only while discovering), so this moves the lock to the appropriate place. Test Plan: tested in production Reviewers: jungejason, epriestley, vrana Reviewed By: jungejason CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2890
This commit is contained in:
		@@ -136,19 +136,19 @@ final class PhabricatorRepositoryPullLocalDaemon
 | 
			
		||||
          $callsign = $repository->getCallsign();
 | 
			
		||||
          $this->log("Updating repository '{$callsign}'.");
 | 
			
		||||
 | 
			
		||||
          $lock_name = get_class($this).':'.$callsign;
 | 
			
		||||
          $lock = PhabricatorGlobalLock::newLock($lock_name);
 | 
			
		||||
          $lock->lock();
 | 
			
		||||
 | 
			
		||||
          $this->pullRepository($repository);
 | 
			
		||||
 | 
			
		||||
          if (!$no_discovery) {
 | 
			
		||||
            $lock_name = get_class($this).':'.$callsign;
 | 
			
		||||
            $lock = PhabricatorGlobalLock::newLock($lock_name);
 | 
			
		||||
            $lock->lock();
 | 
			
		||||
 | 
			
		||||
            // TODO: It would be nice to discover only if we pulled something,
 | 
			
		||||
            // but this isn't totally trivial.
 | 
			
		||||
            $this->discoverRepository($repository);
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          $lock->unlock();
 | 
			
		||||
            $lock->unlock();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          $sleep_for = $repository->getDetail('pull-frequency', $min_sleep);
 | 
			
		||||
          $retry_after[$id] = time() + $sleep_for;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user