Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F22996935
D13525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13525.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 10:37 AM (4 h, 31 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
17407529
Default Alt Text
D13525.diff (1 KB)
Attached To
Mode
D13525: [drydock/aws] Check that the instance started by a spot request is API consistent
Attached
Detach File
Event Timeline
Log In to Comment