diff options
author | Tomás Touceda <chiiph@leap.se> | 2014-03-17 11:44:58 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2014-03-17 11:44:58 -0300 |
commit | c0ac189e565c9cfc453db4d1ef77cc4c48f17584 (patch) | |
tree | 2cfc10371e4dba5cdde021ffb87a1aec4d4526c9 | |
parent | 036392269c30ca3468225d8aa4fc1540629071ec (diff) | |
parent | a2e2356ff0d740441b3431be0a2e095940412b2a (diff) |
Merge remote-tracking branch 'refs/remotes/kali/bug/catch-shutdown-errors' into develop
-rw-r--r-- | changes/bug-shutdown-errors | 1 | ||||
-rw-r--r-- | src/leap/bitmask/backend.py | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/changes/bug-shutdown-errors b/changes/bug-shutdown-errors new file mode 100644 index 00000000..a2de1249 --- /dev/null +++ b/changes/bug-shutdown-errors @@ -0,0 +1 @@ +- Catch shutdown errors. Closes: #5313 diff --git a/src/leap/bitmask/backend.py b/src/leap/bitmask/backend.py index 34457e34..99e5a04b 100644 --- a/src/leap/bitmask/backend.py +++ b/src/leap/bitmask/backend.py @@ -325,7 +325,8 @@ class Backend(object): Stops the looping call and tries to cancel all the defers. """ log.msg("Stopping worker...") - self._lc.stop() + if self._lc.running: + self._lc.stop() while len(self._ongoing_defers) > 0: d = self._ongoing_defers.pop() d.cancel() @@ -392,7 +393,8 @@ class Backend(object): :param d: defer to remove :type d: twisted.internet.defer.Deferred """ - self._ongoing_defers.remove(d) + if d in self._ongoing_defers: + self._ongoing_defers.remove(d) # XXX: Temporal interface until we migrate to zmq # We simulate the calls to zmq.send_multipart. Once we separate |