@@ -134,10 +134,10 @@ def main():
134134
135135 logger .debug ('Done' )
136136 except CollectedExceptions as exc :
137- logger .error ('Failed: %r' , args . command , exc )
137+ logger .error ('Failed: %r' , exc )
138138 sys .exit (f'ERROR ({ args .command } ): { exc } ' )
139139 except Exception as exc :
140- logger .exception ('Failed: %r' , args . command , exc )
140+ logger .exception ('Failed: %r' , exc )
141141 sys .exit (f'ERROR ({ args .command } ): { exc } ' )
142142
143143
@@ -250,14 +250,14 @@ def read_worker():
250250 # Probably `[Errno 29] Illegal seek` when reading from pipe e.g. from pv command
251251 source_end_offset = None
252252
253+ except Exception as exc :
254+ logger .exception ('do_checksum read_worker failed: %r' , exc )
255+ exception_collector .collect_exception (exc )
253256 except BaseException as exc :
254257 # not sure what the exception could be, but let's log it and re-raise it
255258 logger .exception ('do_checksum read_worker failed (BaseException): %r' , exc )
256259 exception_collector .collect_exception (exc )
257260 raise exc
258- except Exception as exc :
259- logger .exception ('do_checksum read_worker failed: %r' , exc )
260- exception_collector .collect_exception (exc )
261261 finally :
262262 for _ in range (worker_count ):
263263 block_queue .put (None )
@@ -320,14 +320,14 @@ def send_worker():
320320 hash_output_stream .write (block_hash )
321321 finally :
322322 send_queue .task_done ()
323+ except Exception as exc :
324+ logger .exception ('do_checksum send_worker failed: %r' , exc )
325+ exception_collector .collect_exception (exc )
323326 except BaseException as exc :
324327 # not sure what the exception could be, but let's log it and re-raise it
325328 logger .exception ('do_checksum send_worker failed (BaseException): %r' , exc )
326329 exception_collector .collect_exception (exc )
327330 raise exc
328- except Exception as exc :
329- logger .exception ('do_checksum send_worker failed: %r' , exc )
330- exception_collector .collect_exception (exc )
331331
332332 futures = [
333333 executor .submit (read_worker ),
@@ -513,14 +513,14 @@ def flush_hash_batch():
513513 # Do not trigger the exception collector - it would make other threads terminate.
514514 # But do set some flag that the whole workflow is not running successfully.
515515 encountered_incomplete_read = exc
516+ except Exception as exc :
517+ logger .exception ('do_retrieve read_worker failed: %r' , exc )
518+ exception_collector .collect_exception (exc )
516519 except BaseException as exc :
517520 # not sure what the exception could be, but let's log it and re-raise it
518521 logger .exception ('do_retrieve read_worker failed (BaseException): %r' , exc )
519522 exception_collector .collect_exception (exc )
520523 raise exc
521- except Exception as exc :
522- logger .exception ('do_retrieve read_worker failed: %r' , exc )
523- exception_collector .collect_exception (exc )
524524 finally :
525525 for _ in range (worker_count ):
526526 hash_queue .put (None )
@@ -592,14 +592,14 @@ def send_worker():
592592 block_output_stream .flush ()
593593 finally :
594594 send_queue .task_done ()
595+ except Exception as exc :
596+ logger .exception ('do_retrieve send_worker failed: %r' , exc )
597+ exception_collector .collect_exception (exc )
595598 except BaseException as exc :
596599 # not sure what the exception could be, but let's log it and re-raise it
597600 logger .exception ('do_retrieve send_worker failed (BaseException): %r' , exc )
598601 exception_collector .collect_exception (exc )
599602 raise exc
600- except Exception as exc :
601- logger .exception ('do_retrieve send_worker failed: %r' , exc )
602- exception_collector .collect_exception (exc )
603603
604604 futures = [
605605 executor .submit (read_worker ),
0 commit comments