Page MenuHomePhabricator

D13421.id32502.diff
No OneTemporary

D13421.id32502.diff

Index: src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
@@ -695,8 +695,12 @@
pht('Waiting for successful %s connection', $protocol_name));
$resource->save();
+ $last_attempt = PhabricatorTime::getNow();
+
while (true) {
try {
+ $last_attempt = PhabricatorTime::getNow();
+
$this->log(pht(
'Attempting to connect to \'%s\' via %s',
$instance_id,
@@ -776,6 +780,16 @@
throw new Exception(
'Allocated instance, but ended up in unexpected state \''.
$instance_state.'\'!');
+ } else {
+ $check_time = PhabricatorTime::getNow() - $last_attempt;
+ if ($check_time < 60) {
+ $this->log(pht(
+ '%s connection returned too quickly, manually sleeping '.
+ 'for %d seconds to avoid a large number of AWS calls.',
+ $protocol_name,
+ $check_time));
+ sleep($check_time);
+ }
}
continue;

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 25, 11:07 AM (10 h, 4 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7047903
Default Alt Text
D13421.id32502.diff (1 KB)

Event Timeline