def auto_exec_task(exp, scope_name, is_init=False): r = get_redis_instance() lock_key = ExpKeys.get_auto_exec_task_lock_key(exp.pk, scope_name) with redis_lock.Lock(r, lock_key): try: sr = ScopeRunner(exp, scope_name) sr.execute(is_init) except Exception, e: log.exception(e)
def auto_exec_task(exp, scope_name, is_init=False): r = get_redis_instance() lock_key = ExpKeys.get_auto_exec_task_lock_key(exp.pk, scope_name) with redis_lock.Lock(r, lock_key): try: sr = ScopeRunner(exp, scope_name) sr.execute(is_init) except Exception, e: log.exception(e)
def auto_exec_task(exp, scope_name, is_init=False): r = get_redis_instance() lock_key = ExpKeys.get_auto_exec_task_lock_key(exp.pk, scope_name) with redis_lock.Lock(r, lock_key): try: sr = ScopeRunner(exp, scope_name) sr.execute(is_init) exp.log("root", "Scope %s finished" % scope_name, "INFO") except Exception, e: exp.error() exp.log("root", e.message, "CRITICAL") log.exception(e)
def halt_execution_task(exp, scope_name): log.debug("halt execution invoked") r = get_redis_instance() lock_key = ExpKeys.get_auto_exec_task_lock_key(exp.pk, scope_name) with redis_lock.Lock(r, lock_key): try: if scope_name == "root": AllUpdated( exp.pk, comment=u"An error occurred during experiment execution", silent=False, mode=NotifyMode.ERROR).send() else: block = exp.get_meta_block_by_sub_scope(scope_name) block.do_action("error", exp) except Exception, e: log.exception(e)
def halt_execution_task(exp, scope_name): log.debug("halt execution invoked") r = get_redis_instance() lock_key = ExpKeys.get_auto_exec_task_lock_key(exp.pk, scope_name) with redis_lock.Lock(r, lock_key): try: if scope_name == "root": AllUpdated( exp.pk, comment=u"An error occurred during experiment execution", silent=False, mode=NotifyMode.ERROR ).send() else: block = exp.get_meta_block_by_sub_scope(scope_name) block.do_action("error", exp) except Exception, e: log.exception(e)