Skip to content

Commit

Permalink
Make thread reaper more tolerant; see issue #1367
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Aug 6, 2015
1 parent a277ffc commit 22cf671
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mailpile/crypto/gpgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,12 @@ def run(self,
return gpg_retcode, self.outputbuffers

def _reap_threads(self):
for name, thr in self.threads.iteritems():
if thr.isAlive():
thr.join(timeout=15)
for tries in (1, 2, 3):
for name, thr in self.threads.iteritems():
if thr.isAlive():
print 'SCARY WARNING: FAILED TO REAP THREAD %s' % thr
thr.join(timeout=15)
if thr.isAlive() and tries > 1:
print 'WARNING: Failed to reap thread %s' % thr

def parse_status(self, line, *args):
self.debug('<<STATUS<< %s' % line)
Expand Down

0 comments on commit 22cf671

Please sign in to comment.