Bug 1322 - l'état des machines affichée par la page clusterstatus n'est pas fiable

désormais, pour éviter toute confusion, pour toutes le machines qui ne répondent pas :
- le load n'est plus affiché
- le bouton power affiche unknown
This commit is contained in:
Guillaume Raffy 2016-05-03 12:19:24 +00:00
parent 1e6a5247d8
commit c0fa682d20
3 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ class JobStateFlags:
DELETED=16
HOLD=32
ERROR=64
SUSPENDED=128
class ParallelEnvironment:
MPI=1

View File

@ -23,6 +23,8 @@ class QstatParser:
jobState += JobStateFlags.DELETED
elif c == 'h':
jobState += JobStateFlags.HOLD
elif c == 's':
jobState += JobStateFlags.SUSPENDED
elif c == 'E':
jobState += JobStateFlags.ERROR
else:
@ -42,6 +44,8 @@ class QstatParser:
queueMachineState += QueueMachineStateFlags.ERROR
elif c == 'o':
queueMachineState += QueueMachineStateFlags.OBSOLETE
elif c == 's':
queueMachineState += QueueMachineStateFlags.SUSPENDED
else:
assert False, 'unhandled queue machine state flag :"' + c + '"'
return queueMachineState

View File

@ -5,6 +5,7 @@ class QueueMachineStateFlags: #
UNKNOWN=4 # the queue machine is in unknown state because sge_execd cannot be contected (see man qstat)
ERROR=8 # the queue is in error state
OBSOLETE=16 # the queue no longer exists but it is still visible because it still contains running jobs
SUSPENDED=32 # the queue machine is suspended
class QueueMachine:
"""
@ -49,6 +50,12 @@ class QueueMachine:
return self.m_stateFlags & QueueMachineStateFlags.DISABLED
def isInErrorState( self ):
return self.m_stateFlags & QueueMachineStateFlags.ERROR
def isResponding( self ):
return not (self.m_stateFlags & QueueMachineStateFlags.UNKNOWN)
def isInAlarmState( self ):
return self.m_stateFlags & QueueMachineStateFlags.ALARM
def isSuspended( self ):
return self.m_stateFlags & QueueMachineStateFlags.SUSPENDED
"""
def getStateAsString( self ):
assert( self.m_strState != None )