Page MenuHomePhabricator

D10871.diff
No OneTemporary

D10871.diff

diff --git a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
@@ -871,7 +871,12 @@
if ($resource->getStatus() != DrydockResourceStatus::STATUS_OPEN) {
$message = pht(
- 'Resource %d did not move into an open status',
+ 'This lease was dependent on resource %d moving into the '.
+ 'open status (i.e. there were multiple leases about to '.
+ 'use the same resource being allocated). However the '.
+ 'resource did not allocate successfully and has been '.
+ 'moved into a non-open status. Check the drydock logs '.
+ 'of that resource to determine the failure reason.',
$resource->getID());
$this->log($message);
throw new Exception($message);
diff --git a/src/applications/drydock/worker/DrydockAllocatorWorker.php b/src/applications/drydock/worker/DrydockAllocatorWorker.php
--- a/src/applications/drydock/worker/DrydockAllocatorWorker.php
+++ b/src/applications/drydock/worker/DrydockAllocatorWorker.php
@@ -356,7 +356,8 @@
$blueprint->allocateResource($resource, $lease);
} catch (Exception $ex) {
- $resource->delete();
+ $resource->setStatus(DrydockResourceStatus::STATUS_BROKEN);
+ $resource->save();
throw $ex;
}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 22, 8:36 PM (4 h, 47 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7226289
Default Alt Text
D10871.diff (1 KB)

Event Timeline