diff --git a/workflow/lib/idds/iworkflow/asyncresult.py b/workflow/lib/idds/iworkflow/asyncresult.py index 41eaefd1..06666233 100644 --- a/workflow/lib/idds/iworkflow/asyncresult.py +++ b/workflow/lib/idds/iworkflow/asyncresult.py @@ -140,6 +140,7 @@ def __init__(self, work_context, name=None, wait_num=1, wait_keys=[], multi_jobs self._bad_results = [] self._results_percentage = 0 self._map_results = map_results + self.waiting_result_terminated = False self._wait_num = wait_num if not self._wait_num: @@ -432,10 +433,13 @@ def wait_results(self, timeout=None, force_return_results=False): time.sleep(1) if percent >= self._wait_percent: get_results = True + self.waiting_result_terminated = True + self.logger.info("Got result percentage %s is not smaller then wait_percent %s, set waiting_result_terminated to True" % (percent, self._wait_percent)) if self._timeout is not None and self._timeout > 0 and time.time() - time_start > self._timeout: # global timeout - self.logger.info("Waiting result timeout(%s seconds)" % self._timeout) + self.logger.info("Waiting result timeout(%s seconds), set waiting_result_terminated to True" % self._timeout) get_results = True + self.waiting_result_terminated = True if timeout is not None and timeout > 0 and time.time() - time_start > timeout: # local timeout break diff --git a/workflow/lib/idds/iworkflow/work.py b/workflow/lib/idds/iworkflow/work.py index ea044f10..f15e9cb3 100644 --- a/workflow/lib/idds/iworkflow/work.py +++ b/workflow/lib/idds/iworkflow/work.py @@ -748,8 +748,10 @@ def wait_results(self): # time.sleep(10) ret = async_ret.wait_results(timeout=10) if ret: - logging.info("Recevied result: %s" % ret) + logging.info("Recevied result: %s" % str(ret)) break + if async_ret.waiting_result_terminated: + logging.info("waiting_result_terminated is set, Received result is: %s" % str(ret)) if time.time() - time_last_check_status > 600: # 10 minutes status = self.get_status() time_last_check_status = time.time()