Bug 1318597 - Explicitly call manager.shutdown() after running mozlint, r?mshal draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 23 Jan 2017 17:35:03 -0500
changeset 465711 09c04f3e5d708f37c217b7b0824d440af5b92b0b
parent 465527 8ff550409e1d1f8b54f6f7f115545dbef857be0b
child 543228 385a71d7c7357655cc6d5ee495b76eb8ea2368c8
push id42685
push userahalberstadt@mozilla.com
push dateTue, 24 Jan 2017 18:30:41 +0000
reviewersmshal
bugs1318597
milestone54.0a1
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
python/mozlint/mozlint/roller.py
--- 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