No need to worry about this condition.

This commit is contained in:
Ralph Bean
2016-07-23 21:06:34 -04:00
parent 08b694cd6b
commit 9177f4ed5c

View File

@@ -49,12 +49,15 @@ def wait(config, session, msg):
in rida.schedulers.handlers.repos.
"""
build = rida.database.ModuleBuild.from_module_event(session, msg)
log.info("Found build=%r from message" % build)
module_info = build.json()
if module_info['state'] != rida.BUILD_STATES["wait"]:
# XXX: not sure why did we get here from state == 2 (building) FIXTHIS
log.error("Invalid state %s for wait(). Msg=%s" % (module_info['state'], msg))
return
log.info("Found module_info=%s from message" % module_info)
if module_info['state'] != msg['msg']['state']:
log.warn("Note that retrieved module state %r "
"doesn't match message module state %r" % (
module_info['state'], msg['msg']['state']))
# This is ok.. it's a race condition we can ignore.
pass
pdc_session = rida.pdc.get_pdc_client_session(config)
tag = rida.pdc.get_module_tag(pdc_session, module_info, strict=True)