WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
225189
Stopping LayoutTest WebSocket Server turns it into a zombie
https://bugs.webkit.org/show_bug.cgi?id=225189
Summary
Stopping LayoutTest WebSocket Server turns it into a zombie
Sam Sneddon [:gsnedders]
Reported
2021-04-29 06:11:30 PDT
Stopping the WebSocket server on Linux always hits the timeout:
> __GI___select (/usr/lib/libc-2.33.so:0) > _wait_for_action (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py:203) > _stop_running_server (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py:213) > _stop_running_server (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py:174) > stop (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py:140) > stop_websocket_server (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/port/base.py:978) > stop_servers (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:229) > run (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:442) > run (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:488) > main (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:93) > <module> (/mnt/home-extra/gsnedders/Documents/other-projects/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:495)
_wait_for_action sleep-loops until its action returns True; it is called with Lighttpd._check_and_kill as the action from its caller. This action essentially checks Executive.check_running_pid (which calls kill(pid, 0)) and then calls Executive.kill_process if that's True. However, despite the long delay, it appears that the first Executive.kill_process is killing it, turning it into a zombie. It appears that on Darwin, kill(pid, 0) returns non-zero when pid is a zombie, but on GNU/Linux the same returns 0 when pid is a zombie. We should really be calling os.wait (or, better, keeping the subprocess.Popen object around to call Popen.wait) while waiting for it to stop. This is somewhat painful on Py<3.3, given os.wait itself just busyloops until it succeeds, whereas we really want to have some timeout there.
Attachments
Patch
(5.54 KB, patch)
2021-10-29 09:43 PDT
,
Sam Sneddon [:gsnedders]
no flags
Details
Formatted Diff
Diff
Patch
(6.61 KB, patch)
2021-10-29 10:34 PDT
,
Sam Sneddon [:gsnedders]
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-05-06 06:12:16 PDT
<
rdar://problem/77604119
>
Sam Sneddon [:gsnedders]
Comment 2
2021-10-29 09:43:19 PDT
Created
attachment 442825
[details]
Patch
Sam Sneddon [:gsnedders]
Comment 3
2021-10-29 10:00:21 PDT
EWS failures (both Py2 and Py3) for webkitpy are: [660/2054] webkitpy.layout_tests.servers.http_server_unittest.TestHttpServer.test_win32_start_and_stop erred: Traceback (most recent call last): File "/Volumes/Data/worker/WebKitPy-Tests-EWS/build/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py", line 107, in test_win32_start_and_stop self.assertEqual(['taskkill.exe', '/f', '/t', '/pid', 42], host.executive.calls[1]) IndexError: list index out of range
Sam Sneddon [:gsnedders]
Comment 4
2021-10-29 10:34:34 PDT
Created
attachment 442842
[details]
Patch
EWS
Comment 5
2021-10-30 10:09:59 PDT
Committed
r285081
(
243723@main
): <
https://commits.webkit.org/243723@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 442842
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug