[PATCH] D65421: Make lit.py abort_now() kill the worker process more precisely

Cassie Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 15:28:45 PDT 2019


porglezomp created this revision.
porglezomp added reviewers: lattner, rnk.
Herald added subscribers: llvm-commits, delcypher.
Herald added a project: LLVM.

Previously, `abort_now` in lit.py was killing the entire process group if you weren't on Windows, using `os.kill(0, 9)`. This seems to immediately kill the main process in addition to the worker, at least on macOS. Just killing the worker process explicitly by PID still has the process cleaning up without printing everything, and now it exits with the expected exit code 2 instead of the 137 from SIGKILL.

I'm interested in this change as a first step to letting lit print out a partial report when it's interrupted mid-run, which I've wanted while making changes to particularly slow-running test setups.


Repository:
  rL LLVM

https://reviews.llvm.org/D65421

Files:
  utils/lit/lit/run.py


Index: utils/lit/lit/run.py
===================================================================
--- utils/lit/lit/run.py
+++ utils/lit/lit/run.py
@@ -22,7 +22,7 @@
     if win32api:
         win32api.TerminateProcess(win32api.GetCurrentProcess(), 3)
     else:
-        os.kill(0, 9)
+        os.kill(multiprocessing.current_process().pid, 9)
 
 class _Display(object):
     def __init__(self, display, provider, maxFailures):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65421.212233.patch
Type: text/x-patch
Size: 427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190729/b800907c/attachment-0001.bin>


More information about the llvm-commits mailing list