diff --git a/doma/lib/idds/doma/workflowv2/domapandawork.py b/doma/lib/idds/doma/workflowv2/domapandawork.py index 70746b95..730ff4b7 100644 --- a/doma/lib/idds/doma/workflowv2/domapandawork.py +++ b/doma/lib/idds/doma/workflowv2/domapandawork.py @@ -1235,22 +1235,38 @@ def get_event_job(self, sub_map_id, panda_jobs, job_set_events): for event_id in events: event_index = int(event_id.split('-')[3]) - 1 if event_index == sub_map_id: - event_status = events[event_id] + event_result = events[event_id] + if type(event_result) in [dict]: + # new version of panda result + event_status = event_result.get('status', None) + event_error = event_result.get('error', None) + event_diag = event_result.get('diag', None) + else: + event_status = event_result + event_error, event_diag = None, None if event_status not in sub_map_id_jobs: sub_map_id_jobs[event_status] = [] # todo: get the event error code and error diag - item = {'status': event_status, 'error_code': None, 'error_diag': None, 'job': panda_job} + item = {'status': event_status, 'error_code': event_error, 'error_diag': event_diag, 'job': panda_job} sub_map_id_jobs[event_status].append(item) if not ret_event: for event_id in job_set_events: event_index = int(event_id.split('-')[3]) - 1 if event_index == sub_map_id: - event_status = job_set_events[event_id] + event_result = job_set_events[event_id] + if type(event_result) in [dict]: + # new version of panda result + event_status = event_result.get('status', None) + event_error = event_result.get('error', None) + event_diag = event_result.get('diag', None) + else: + event_status = event_result + event_error, event_diag = None, None if event_status not in sub_map_id_jobs: sub_map_id_jobs[event_status] = [] # todo: get the event error code and error diag - item = {'status': event_status, 'error_code': None, 'error_diag': None} + item = {'status': event_status, 'error_code': event_error, 'error_diag': event_diag} sub_map_id_jobs[event_status].append(item) final_event_status = None @@ -1478,7 +1494,6 @@ def get_update_contents(self, unterminated_jobs_status, input_output_maps, conte for content in output_contents: sub_map_id = content['sub_map_id'] - self.logger.debug("wen") # min_id = content['min_id'] # min_id should be the same as sub_map_id here event, event_panda_job = self.get_event_job(sub_map_id, panda_jobs, job_set_events) self.logger.debug("sub_map_id: %s, panda_jobs: %s, job_set_events: %s, event: %s, event_panda_job: %s" % (sub_map_id, panda_jobs, job_set_events, event, event_panda_job)) diff --git a/main/lib/idds/tests/panda_test.py b/main/lib/idds/tests/panda_test.py index 8fd68a49..0a45a4da 100644 --- a/main/lib/idds/tests/panda_test.py +++ b/main/lib/idds/tests/panda_test.py @@ -7,8 +7,8 @@ os.environ['PANDA_URL_SSL'] = 'https://pandaserver-doma.cern.ch:25443/server/panda' os.environ['PANDA_BEHIND_REAL_LB'] = "1" -# os.environ['PANDA_URL'] = 'http://rubin-panda-server-dev.slac.stanford.edu:80/server/panda' -# os.environ['PANDA_URL_SSL'] = 'https://rubin-panda-server-dev.slac.stanford.edu:8443/server/panda' +os.environ['PANDA_URL'] = 'http://rubin-panda-server-dev.slac.stanford.edu:80/server/panda' +os.environ['PANDA_URL_SSL'] = 'https://rubin-panda-server-dev.slac.stanford.edu:8443/server/panda' # os.environ['PANDA_URL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda' # os.environ['PANDA_URL_SSL'] = 'https://usdf-panda-server.slac.stanford.edu:8443/server/panda' @@ -48,6 +48,7 @@ task_ids = [i for i in range(167781, 167785)] task_ids = [i for i in range(166799, 167877)] task_ids = [i for i in range(167997, 168003)] +task_ids = [688, 8686, 8695, 8696] for task_id in task_ids: print("Killing %s" % task_id) ret = Client.killTask(task_id, verbose=True)