Page MenuHomePhabricator

D13421.id.diff
No OneTemporary

D13421.id.diff

Index: src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
@@ -727,8 +727,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,
@@ -808,6 +812,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,
+ 60 - $check_time));
+ sleep(60 - $check_time);
+ }
}
continue;
@@ -925,8 +939,8 @@
'%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);
+ 60 - $check_time));
+ sleep(60 - $check_time);
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 25, 6:45 AM (5 h, 35 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7047902
Default Alt Text
D13421.id.diff (1 KB)

Event Timeline