WebKit Bugzilla
Attachment 339207 Details for
Bug 185164
: webkitpy: SIGKILL right after SIGTERM causes orphaned processes with 'xcrun simctl spawn'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185164-20180501114026.patch (text/plain), 3.48 KB, created by
Jonathan Bedard
on 2018-05-01 11:40:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-05-01 11:40:27 PDT
Size:
3.48 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 231201) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-05-01 Jonathan Bedard <jbedard@apple.com> >+ >+ webkitpy: SIGKILL right after SIGTERM causes orphaned processes with 'xcrun simctl spawn' >+ https://bugs.webkit.org/show_bug.cgi?id=185164 >+ >+ Reviewed by David Kilzer. >+ >+ * Scripts/webkitpy/common/system/executive.py: >+ (Executive.kill_process): First attempt will always send a SIGTERM, all subsequent attempts will >+ send a SIGKILL. A SIGKILL with not be sent if the process is not running to avoid orphaning childen. >+ > 2018-05-01 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] remove WK1 support >Index: Tools/Scripts/webkitpy/common/system/executive.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/executive.py (revision 231201) >+++ Tools/Scripts/webkitpy/common/system/executive.py (working copy) >@@ -180,31 +180,33 @@ class Executive(AbstractExecutive): > # According to http://docs.python.org/library/os.html > # os.kill isn't available on Windows. python 2.5.5 os.kill appears > # to work in cygwin, however it occasionally raises EAGAIN. >- retries_left = 10 if sys.platform == "cygwin" else 1 >- while retries_left > 0: >+ retries_left = 10 if sys.platform == "cygwin" else 2 >+ current_signal = signal.SIGTERM >+ while retries_left > 0 and self.check_running_pid(pid): > try: > retries_left -= 1 >- # Give processes one change to clean up quickly before exiting. >- # Following up with a kill should have no effect if the process >- # already exited, and forcefully kill it if SIGTERM wasn't enough. >- os.kill(pid, signal.SIGTERM) >- os.kill(pid, signal.SIGKILL) >+ os.kill(pid, current_signal) > except OSError as e: >- if e.errno == errno.EAGAIN: >+ if current_signal == signal.SIGTERM: >+ pass >+ elif e.errno == errno.EAGAIN: > if retries_left <= 0: > _log.warn("Failed to kill pid %s. Too many EAGAIN errors." % pid) >- continue >- if e.errno == errno.ESRCH: # The process does not exist. >+ elif e.errno == errno.ESRCH: # The process does not exist. > return >- if e.errno == errno.EPIPE: # The process has exited already on cygwin >+ elif e.errno == errno.EPIPE: # The process has exited already on cygwin > return >- if e.errno == errno.ECHILD: >+ elif e.errno == errno.ECHILD: > # Can't wait on a non-child process, but the kill worked. > return >- if e.errno == errno.EACCES and sys.platform == 'cygwin': >+ elif e.errno == errno.EACCES and sys.platform == 'cygwin': > # Cygwin python sometimes can't kill native processes. > return >- raise >+ else: >+ raise >+ >+ # Give processes one chance to clean up quickly before exiting. >+ current_signal = signal.SIGKILL > > def _win32_check_running_pid(self, pid): > # importing ctypes at the top-level seems to cause weird crashes at
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185164
:
339199
|
339203
| 339207