Skip to content

Commit a714f7b

Browse files
author
Scott Collins
committed
Broadened exception handling during batch processing to maximize potential to recover from tranfer errors on individual files
1 parent 6b55414 commit a714f7b

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/pds/ingress/client/pds_ingress_client.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
from pds.ingress.util.report_util import read_manifest_file
4949
from pds.ingress.util.report_util import update_summary_table
5050
from pds.ingress.util.report_util import write_manifest_file
51-
from requests.exceptions import RequestException
5251
from tqdm.utils import CallbackIOWrapper
5352

5453
BEARER_TOKEN = None
@@ -191,20 +190,17 @@ def _process_batch(batch_index, request_batch, node_id, force_overwrite, api_gat
191190
ingress_file_to_s3(ingress_response, batch_index, batch_pbar)
192191

193192
batch_pbar.update()
194-
except RequestException as err:
193+
except Exception as err:
195194
# If here, the HTTP request error was unrecoverable by a backoff/retry
196195
trimmed_path = ingress_response.get("trimmed_path")
197196
ingress_path = ingress_response.get("ingress_path")
198197
update_summary_table(SUMMARY_TABLE, "failed", ingress_path)
199198

200-
logger.error(
201-
"Batch %d : Ingress failed for %s, HTTP code: %s\n HTTP response text:\n%s",
202-
batch_index,
203-
trimmed_path,
204-
str(err.response.status_code) if err.response else "None",
205-
err.response.text if err.response else "None",
206-
)
199+
logger.error("Batch %d : Ingress failed for %s, Reason:\n%s", batch_index, trimmed_path, str(err))
200+
201+
continue # Move to next file in the batch
207202
except Exception as err:
203+
# Hit an unrecoverable error while processing the batch
208204
logger.error("Ingress failed, reason: %s", str(err))
209205
raise
210206
finally:

0 commit comments

Comments
 (0)