Description
Description
Related Objects
Related Objects
Event Timeline
Comment Actions
(For reference, see discussion elsewhere.)
diff --git a/src/applications/almanac/storage/AlmanacService.php b/src/applications/almanac/storage/AlmanacService.php index 9ef42d6407..1ac6db95dd 100644 --- a/src/applications/almanac/storage/AlmanacService.php +++ b/src/applications/almanac/storage/AlmanacService.php @@ -103,6 +103,18 @@ final class AlmanacService return $bindings; } + public function getActiveBindingsForTraffic() { + $bindings = $this->getActiveBindings(); + + foreach ($bindings as $key => $binding) { + if ($binding->getAlmanacPropertyValue('offline')) { + unset($bindings[$key]); + } + } + + return $bindings; + } + public function attachBindings(array $bindings) { $this->bindings = $bindings; return $this; diff --git a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php index e87c798e28..d4dd9a1d6d 100644 --- a/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php +++ b/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php @@ -629,7 +629,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject { } $device_map = array_fuse($device_phids); - $bindings = $service->getActiveBindings(); + $bindings = $service->getActiveBindingsForTraffic(); $fetchable = array(); foreach ($bindings as $binding) { diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index fd7413c392..5b96d0758b 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1949,7 +1949,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO return null; } - $bindings = $service->getActiveBindings(); + $bindings = $service->getActiveBindingsForTraffic(); if (!$bindings) { throw new Exception( pht(
Comment Actions
DiffusionSSHWorkflow->execute() currently makes a proxying decision before it determines if a request is a read or write request. This needs to be reworked before we can support separate flags, since the host we'd choose to proxy the request will vary if only some hosts are readable/writable.
This isn't a huge issue, but since reworking (and testing the reworking) is somewhat substantive I think a crude fix is probably not a good shortcut here. Particularly, all the testing for changes here could save a lot of time testing other changes -- like a real fix to T10883 -- so I currently expect to implement this properly rather than provide a shortcut.