Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15391818
D21808.id51978.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21808.id51978.diff
View Options
diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -506,28 +506,21 @@
protected function shouldLimitAllocatingPoolSize(
DrydockBlueprint $blueprint) {
- // TODO: If this mechanism sticks around, these values should be
- // configurable by the blueprint implementation.
-
// Limit on total number of active resources.
$total_limit = $this->getConcurrentResourceLimit($blueprint);
-
- // Always allow at least this many allocations to be in flight at once.
- $min_allowed = 1;
-
- // Allow this fraction of allocating resources as a fraction of active
- // resources.
- $growth_factor = 0.25;
+ if ($total_limit === null) {
+ return false;
+ }
$resource = new DrydockResource();
- $conn_r = $resource->establishConnection('r');
+ $conn = $resource->establishConnection('r');
$counts = queryfx_all(
- $conn_r,
- 'SELECT status, COUNT(*) N FROM %T
+ $conn,
+ 'SELECT status, COUNT(*) N FROM %R
WHERE blueprintPHID = %s AND status != %s
GROUP BY status',
- $resource->getTableName(),
+ $resource,
$blueprint->getPHID(),
DrydockResourceStatus::STATUS_DESTROYED);
$counts = ipull($counts, 'N', 'status');
@@ -539,29 +532,12 @@
// If we're at the limit on total active resources, limit additional
// allocations.
- if ($total_limit !== null) {
- $n_total = ($n_alloc + $n_active + $n_broken + $n_released);
- if ($n_total >= $total_limit) {
- return true;
- }
- }
-
- // If the number of in-flight allocations is fewer than the minimum number
- // of allowed allocations, don't impose a limit.
- if ($n_alloc < $min_allowed) {
- return false;
+ $n_total = ($n_alloc + $n_active + $n_broken + $n_released);
+ if ($n_total >= $total_limit) {
+ return true;
}
- $allowed_alloc = (int)ceil($n_active * $growth_factor);
-
- // If the number of in-flight allocation is fewer than the number of
- // allowed allocations according to the pool growth factor, don't impose
- // a limit.
- if ($n_alloc < $allowed_alloc) {
- return false;
- }
-
- return true;
+ return false;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 11:48 AM (6 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7423241
Default Alt Text
D21808.id51978.diff (2 KB)
Attached To
Mode
D21808: Remove the "25% of active pool" growth rate throttle from Drydock
Attached
Detach File
Event Timeline
Log In to Comment