Deal with keyboard interrupt correctly.
This commit is contained in:
parent
1e2d880d6d
commit
795e4bb2db
@ -537,20 +537,23 @@ class MostlyReliablePipe(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _retransmit_check_worker(self):
|
def _retransmit_check_worker(self):
|
||||||
now = time.time()
|
try:
|
||||||
for key in self._incoming.keys()[:]:
|
now = time.time()
|
||||||
message = self._incoming[key]
|
for key in self._incoming.keys()[:]:
|
||||||
if message.complete():
|
message = self._incoming[key]
|
||||||
continue
|
if message.complete():
|
||||||
next_rt = message.next_rt_time()
|
continue
|
||||||
if next_rt == 0 or next_rt > now:
|
next_rt = message.next_rt_time()
|
||||||
continue
|
if next_rt == 0 or next_rt > now:
|
||||||
if self._retransmit_request(message):
|
continue
|
||||||
# Kill the message, too many retries
|
if self._retransmit_request(message):
|
||||||
print "(MRP): Dropped message %s, exceeded retries." % _stringify_sha(message.sha())
|
# Kill the message, too many retries
|
||||||
self._dispatched[key] = message
|
print "(MRP): Dropped message %s, exceeded retries." % _stringify_sha(message.sha())
|
||||||
message.set_dispatch_time()
|
self._dispatched[key] = message
|
||||||
del self._incoming[key]
|
message.set_dispatch_time()
|
||||||
|
del self._incoming[key]
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _process_incoming_data(self, segment):
|
def _process_incoming_data(self, segment):
|
||||||
|
Loading…
Reference in New Issue
Block a user