You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2016/08/31 20:42:23 UTC
svn commit: r1758683 - /vcl/trunk/web/.ht-inc/utils.php
Author: jfthomps
Date: Wed Aug 31 20:42:23 2016
New Revision: 1758683
URL: http://svn.apache.org/viewvc?rev=1758683&view=rev
Log:
VCL-846 - Improve flow of handling nodes for deleted reservations assigned to new reservations
utils.php:
-modified isAvailable: changed set of ignored states when getting a list of computers for an immediate (now) reservation from 'reloading,reload,timeout,inuse' to 'timeout,inuse'; changed set of states for determing reserved computers from 'deleted,failed,complete' to 'failed,complete,reload,pending/reload'
-modified getSemaphore: changed set of states checked to see if another process allocated the same computer from '1,5,12' to '5,12,19,14/19'
Modified:
vcl/trunk/web/.ht-inc/utils.php
Modified: vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1758683&r1=1758682&r2=1758683&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Wed Aug 31 20:42:23 2016
@@ -4128,7 +4128,9 @@ function isAvailable($images, $imageid,
$vmhostcheckdone = 0;
$ignorestates = "'maintenance','vmhostinuse','hpc','failed'";
if($now)
- $ignorestates .= ",'reloading','reload','timeout','inuse'";
+ # computers from reservations with a user directed reinstall will be in
+ # the reloading state, but they will be removed from the list later on
+ $ignorestates .= ",'timeout','inuse'";
foreach($requestInfo["images"] as $key => $imageid) {
# check for max concurrent usage of image
@@ -4341,7 +4343,8 @@ function isAvailable($images, $imageid,
. "'$endstamp' > rq.start AND "
. "rq.id != $requestid AND "
. "rs.requestid = rq.id AND "
- . "rq.stateid NOT IN (1, 5, 12)"; # deleted, failed, complete
+ . "rq.stateid NOT IN (5, 12, 19) AND " # failed, complete, reload
+ . "(rq.stateid != 14 OR rq.laststateid != 19)"; # pending/reload
$qh = doQuery($query, 130);
while($row = mysql_fetch_row($qh)) {
array_push($usedComputerids, $row[0]);
@@ -4840,7 +4843,8 @@ function getSemaphore($imageid, $imagere
. "rs.computerid = $compid AND "
. "rq.start < '$end' AND "
. "rq.end > '$start' AND "
- . "rq.stateid NOT IN (1, 5, 12)";
+ . "rq.stateid NOT IN (5, 12, 19) AND " # failed, complete, reload
+ . "(rq.stateid != 14 OR rq.laststateid != 19)"; # pending/reload
if($requestid)
$query .= " AND rq.id != $requestid";
$qh = doQuery($query);