From e254ec84434b96974926f947c0dc92601ed4e52c Mon Sep 17 00:00:00 2001 From: Tom Schoonjans Date: Mon, 8 Mar 2021 13:25:51 +0000 Subject: [PATCH] futures.TransferCoordinator: fix cancellation deadlock This patches fixes a deadlock whenever TransferManager._shutdown is called with cancel==True --- s3transfer/futures.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/s3transfer/futures.py b/s3transfer/futures.py index d08cb7b3..595a4683 100644 --- a/s3transfer/futures.py +++ b/s3transfer/futures.py @@ -273,14 +273,10 @@ def cancel(self, msg='', exc_type=CancelledError): """ with self._lock: if not self.done(): - should_announce_done = False logger.debug('%s cancel(%s) called', self, msg) self._exception = exc_type(msg) - if self._status == 'not-started': - should_announce_done = True self._status = 'cancelled' - if should_announce_done: - self.announce_done() + self.announce_done() def set_status_to_queued(self): """Sets the TransferFutrue's status to running"""