Skip to content

Commit 22b8346

Browse files
author
Matthew Fisher
committed
Merge pull request #3277 from bacongobbler/debug-container-state
fix(controller): use same API call to determine loadstate
2 parents 19673b2 + ea67e5f commit 22b8346

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

controller/scheduler/fleet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,16 +337,16 @@ def state(self, name):
337337
"deactivating": "down",
338338
}
339339
try:
340-
# NOTE (bacongobbler): this call to ._get_unit() also acts as a pre-emptive check to
340+
# NOTE (bacongobbler): this call to ._get_unit() acts as a pre-emptive check to
341341
# determine if the job no longer exists (will raise a RuntimeError on 404)
342-
unit = self._get_unit(name)
342+
self._get_unit(name)
343343
state = self._wait_for_container_state(name)
344344
activeState = state['systemdActiveState']
345345
# FIXME (bacongobbler): when fleet loads a job, sometimes it'll automatically start and
346346
# stop the container, which in our case will return as 'failed', even though
347347
# the container is perfectly fine.
348348
if activeState == 'failed':
349-
if json.loads(unit)['currentState'] == 'loaded':
349+
if state['systemdLoadState'] == 'loaded':
350350
return JobState.created
351351
return getattr(JobState, systemdActiveStateMap[activeState])
352352
except KeyError:

0 commit comments

Comments
 (0)