Page MenuHomePhabricator

D13521.id32689.diff
No OneTemporary

D13521.id32689.diff

Index: src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockMinMaxBlueprintImplementation.php
@@ -66,6 +66,12 @@
DrydockResource $resource,
DrydockLease $lease) {
+ // Always permit the allocation of transient leases, as they will not
+ // keep the resource open.
+ if ($lease->getIsTransientLease()) {
+ return true;
+ }
+
// If the current resource can allocate a lease, allow it.
if ($context->getCurrentResourceLeaseCount() <
$this->getDetail('leases-per-resource')) {
Index: src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockMinMaxExpiryBlueprintImplementation.php
@@ -41,6 +41,12 @@
DrydockResource $resource,
DrydockLease $lease) {
+ // Always permit the allocation of transient leases, as they will not
+ // keep the resource open.
+ if ($lease->getIsTransientLease()) {
+ return true;
+ }
+
// If we have no leases allocated to this resource, then we always allow
// the parent logic to evaluate. The reason for this is that an expired
// resource can only be closed when a lease is released, so if the resource
@@ -87,8 +93,7 @@
if ($lifetime > $expiry) {
$this->log(pht(
- 'Current lifetime of resource exceeds expiry; triggering close',
- $resource->getID()));
+ 'Current lifetime of resource exceeds expiry; triggering close'));
// Force closure of resources that have expired.
return true;

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 5:08 PM (5 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908117
Default Alt Text
D13521.id32689.diff (1 KB)

Event Timeline