Bug 1318597 - Explicitly call manager.shutdown() after running mozlint, r?mshal
This is an educated guess in an attempt to solve a hard to reproduce intermittent. This
also makes sure the original SIGINT handler is restored after running the linters.
MozReview-Commit-ID: HRo0GRlSN5L
--- a/python/mozlint/mozlint/roller.py
+++ b/python/mozlint/mozlint/roller.py
@@ -138,18 +138,21 @@ class LintRoller(object):
workers = []
for i in range(num_procs):
workers.append(
pool.apply_async(_run_worker, args=(queue, paths), kwds=self.lintargs))
pool.close()
# ignore SIGINT in parent so we can still get partial results
# from child processes. These should shutdown quickly anyway.
- signal.signal(signal.SIGINT, signal.SIG_IGN)
+ orig_sigint = signal.signal(signal.SIGINT, signal.SIG_IGN)
self.failed = []
for worker in workers:
# parent process blocks on worker.get()
results, failed = worker.get()
if failed:
self.failed.extend(failed)
for k, v in results.iteritems():
all_results[k].extend(v)
+
+ signal.signal(signal.SIGINT, orig_sigint)
+ m.shutdown()
return all_results