Skip to content

Commit

Permalink
futures.TransferCoordinator: fix cancellation deadlock
Browse files Browse the repository at this point in the history
This patches fixes a deadlock whenever TransferManager._shutdown is
called with cancel==True
  • Loading branch information
tschoonj committed Mar 9, 2021
1 parent a7c59cb commit e254ec8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions s3transfer/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit e254ec8

Please sign in to comment.