Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15429569
D13525.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13525.id.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
Tue, Mar 25, 2:59 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383300
Default Alt Text
D13525.id.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