Differential D11296 Diff 27140 src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | while (!$this->shouldExit()) { | ||||
| // Dequeue repositories until we hit maximum parallelism. | // Dequeue repositories until we hit maximum parallelism. | ||||
| while ($queue && (count($futures) < $max_futures)) { | while ($queue && (count($futures) < $max_futures)) { | ||||
| foreach ($queue as $id => $time) { | foreach ($queue as $id => $time) { | ||||
| $repository = idx($pullable, $id); | $repository = idx($pullable, $id); | ||||
| if (!$repository) { | if (!$repository) { | ||||
| $this->log( | $this->log( | ||||
| pht('Repository %s is no longer pullable; skipping.', $id)); | pht('Repository %s is no longer pullable; skipping.', $id)); | ||||
| break; | continue; | ||||
artms: It seems like if we break, then upper while loop will enter foreach again and it will be a… | |||||
| } | } | ||||
| $monogram = $repository->getMonogram(); | $monogram = $repository->getMonogram(); | ||||
| $this->log(pht('Starting update for repository "%s".', $monogram)); | $this->log(pht('Starting update for repository "%s".', $monogram)); | ||||
| unset($queue[$id]); | unset($queue[$id]); | ||||
| $futures[$id] = $this->buildUpdateFuture( | $futures[$id] = $this->buildUpdateFuture( | ||||
| $repository, | $repository, | ||||
| ▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines | |||||
It seems like if we break, then upper while loop will enter foreach again and it will be a forever loop. I'm not sure if continue is right, maybe we should really (anyway it seems queue will be repopulated on next upper loop iteration):
In our environment pull daemon occasionally goes into loop and never recovers, gdb backtrace tell that daemon is spinning in this loop trying to translate log entry...