From 7719cfd2c23cded904a73b6c14a799c4d920b038 Mon Sep 17 00:00:00 2001 From: Ilija Vukotic Date: Wed, 10 May 2023 01:15:59 -0500 Subject: [PATCH] move to dataset_id --- src/servicex_did_finder_lib/communication.py | 14 +++++++------- src/servicex_did_finder_lib/servicex_adaptor.py | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/servicex_did_finder_lib/communication.py b/src/servicex_did_finder_lib/communication.py index 8127783..2e4bc21 100644 --- a/src/servicex_did_finder_lib/communication.py +++ b/src/servicex_did_finder_lib/communication.py @@ -130,20 +130,20 @@ def rabbit_mq_callback( body ([type]): The body (json for us) of the message file_prefix([str]): Prefix to put in front of file paths to enable use of Cache service """ - request_id = None # set this in case we get an exception while loading request + dataset_id = None # set this in case we get an exception while loading request try: # Unpack the message. Really bad if we fail up here! did_request = json.loads(body) did = did_request["did"] - request_id = did_request["request_id"] + dataset_id = did_request["dataset_id"] __logging.info( - f"Received DID request {did_request}", extra={"requestId": request_id} + f"Received DID request {did_request}", extra={"dataset_id": dataset_id} ) servicex = ServiceXAdapter(did_request["service-endpoint"], file_prefix) servicex.post_status_update("DID Request received") info = { - "request-id": request_id, + "dataset-id": dataset_id, } # Process the request and resolve the DID @@ -152,16 +152,16 @@ def rabbit_mq_callback( except Exception as e: _, exec_value, _ = sys.exc_info() - __logging.exception("DID Request Failed", extra={"requestId": request_id}) + __logging.exception("DID Request Failed", extra={"dataset_id": dataset_id}) servicex.post_status_update( - f"DID Request Failed for id {request_id}: " f"{str(e)} - {exec_value}", + f"DID Request Failed for id {dataset_id}: " f"{str(e)} - {exec_value}", severity="fatal", ) raise except Exception as e: __logging.exception( - f"DID request failed {str(e)}", extra={"requestId": request_id} + f"DID request failed {str(e)}", extra={"dataset_id": dataset_id} ) finally: diff --git a/src/servicex_did_finder_lib/servicex_adaptor.py b/src/servicex_did_finder_lib/servicex_adaptor.py index 7d8e992..544d688 100644 --- a/src/servicex_did_finder_lib/servicex_adaptor.py +++ b/src/servicex_did_finder_lib/servicex_adaptor.py @@ -62,6 +62,8 @@ def post_status_update(self, status_msg, severity="info"): self.logger.error(f'After {attempts} tries, failed to send ServiceX App a status ' f'message: {str(status_msg)} - Ignoring error.') + # not needed anymore + # ???? def _prefix_file(self, file_path): return file_path if not self.file_prefix else self.file_prefix+file_path @@ -114,6 +116,9 @@ def put_file_add_bulk(self, file_list, chunk_length=30): self.logger.error(f'After {attempts} tries, failed to send ServiceX App ' f'a put_file_bulk message: {mesg} - Ignoring error.') + # should be removed... + # transforms can start as soon as request has been made. No need to wait for this. + # whole endpoint '/start' is not needed. def post_transform_start(self): success = False attempts = 0