10586: Add extra notify_all() as deadlock insurance.
authorTom Clegg <tom@curoverse.com>
Mon, 28 Nov 2016 18:46:28 +0000 (13:46 -0500)
committerTom Clegg <tom@curoverse.com>
Mon, 28 Nov 2016 18:46:28 +0000 (13:46 -0500)
sdk/python/arvados/keep.py

index e331621cd94094d1cea4f2e07a25ab2230fc3bc9..c98947945669338384147d9a8a0baf6917c43db9 100644 (file)
@@ -527,6 +527,13 @@ class KeepClient(object):
             with self.pending_tries_notification:
                 while True:
                     if self.pending_copies() < 1:
+                        # This notify_all() is unnecessary --
+                        # write_success() already called notify_all()
+                        # when pending<1 became true, so it's not
+                        # possible for any other thread to be in
+                        # wait() now -- but it's cheap insurance
+                        # against deadlock so we do it anyway:
+                        self.pending_tries_notification.notify_all()
                         # Drain the queue and then raise Queue.Empty
                         while True:
                             self.get_nowait()