Page MenuHomePhabricator

D13525.diff
No OneTemporary

D13525.diff

Index: src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
@@ -409,6 +409,30 @@
'Spot instance request has been fulfilled, and the instance ID is %s.',
$instance_id));
+ // Wait until the instance has appeared.
+ while (true) {
+ try {
+ $result = $this->getAWSEC2Future()
+ ->setRawAWSQuery(
+ 'DescribeInstances',
+ array(
+ 'InstanceId.0' => $instance_id,
+ ))
+ ->resolve();
+ break;
+ } catch (PhutilAWSException $ex) {
+ $this->log(pht(
+ 'Instance could not be found (due '.
+ 'to eventual consistency), trying again in 5 seconds.'));
+ sleep(5);
+ continue;
+ }
+ }
+
+ $this->log(pht(
+ 'Instance %s is now consistent for API access.',
+ $instance_id));
+
} else {
$settings['MinCount'] = 1;
$settings['MaxCount'] = 1;

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 6:25 PM (3 w, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383300
Default Alt Text
D13525.diff (1 KB)

Event Timeline