diff --git a/librarian_background/hypervisor.py b/librarian_background/hypervisor.py index 2b153f7..4555076 100644 --- a/librarian_background/hypervisor.py +++ b/librarian_background/hypervisor.py @@ -16,7 +16,7 @@ from hera_librarian.models.checkin import CheckinStatusRequest, CheckinStatusResponse from hera_librarian.utils import compare_checksums from librarian_server.database import get_session -from librarian_server.logger import ErrorCategory, ErrorSeverity, log_to_database +from librarian_server.logger import ErrorCategory, ErrorSeverity, log, log_to_database from librarian_server.orm import ( Librarian, OutgoingTransfer, @@ -256,11 +256,17 @@ def handle_stale_incoming_transfer( if source_status in [TransferStatus.CANCELLED, TransferStatus.FAILED]: # This one's a gimmie. + log.error( + f"Found end status for incoming transfer {transfer.id} on remote, cancelling" + ) transfer.fail_transfer(session=session, commit=True) return False if source_status == transfer.status: # This is the remote's responsibility. + log.info( + f"Found same for incoming transfer {transfer.id} on remote, continuing" + ) return True # We only get here in annoying scenarios. diff --git a/librarian_server/orm/transfer.py b/librarian_server/orm/transfer.py index a46cabe..edb119f 100644 --- a/librarian_server/orm/transfer.py +++ b/librarian_server/orm/transfer.py @@ -154,11 +154,6 @@ def fail_transfer(self, session: "Session", commit: bool = True): request=request, response=CheckinUpdateResponse, ) - - if not response.success: - raise Exception( - "Remote librarian refused or failed to set transfer status to FAILED." - ) except Exception as e: log.error( f"Failed to communicate to remote librarian that transfer {self.id} "