Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Issue 8633004: Stop WebSocker server processes certainly (Closed)

Created:
9 years, 1 month ago by Takashi Toyoshima
Modified:
9 years, 1 month ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Kill orphaned WebSocker server processes before launching new one in POSIX, or use JobObject to kill child servers on quitting in Win32. Sometime, unexpected existing WebSocket servers cause continuous test failures because they prevent to launch new WebSocket server using the same port. This change kills orphaned WebSocket servers before launching new one in POSIX, or use JobObject to register the server processes must be killed after parent process quit. This mechanism works fine in net/test/test_server_{posix|win}.cc for HTTP servers. BUG=91058 TEST=third_party/WebKit/Tools/Script/new-run-webkit-websocketserver --server=start; ui_tests --gtest_filter="*WorkerWebSocket*" --gtest_also_run_disabled_tests (ui_tests must run by killing existing WebSocket server) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111473

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : Add Win32 impl. #

Total comments: 6

Patch Set 4 : revised #

Total comments: 14

Patch Set 5 : revise #

Patch Set 6 : again #

Total comments: 4

Patch Set 7 : fix and use SetJobObjectAsKillOnJobClose() #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -2 lines) Patch
M chrome/test/base/ui_test_utils.h View 1 2 3 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/test/base/ui_test_utils.cc View 1 2 3 4 5 6 7 chunks +42 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Takashi Toyoshima
Hi chrome/test/OWNERS guys, I'd be happy if one of you could review this change. This ...
9 years, 1 month ago (2011-11-22 04:56:48 UTC) #1
Yuta Kitamura
How about Windows?
9 years, 1 month ago (2011-11-22 05:05:31 UTC) #2
Takashi Toyoshima
> How about Windows? If the host can hold its pid file, new-run-webkit-websocketserver can kill ...
9 years, 1 month ago (2011-11-22 06:43:09 UTC) #3
Yuta Kitamura
On 2011/11/22 06:43:09, toyoshim wrote: > If the host can hold its pid file, new-run-webkit-websocketserver ...
9 years, 1 month ago (2011-11-22 06:47:27 UTC) #4
Yuta Kitamura
websocket.pid file is generated in a temporary directory which is removed every time the server ...
9 years, 1 month ago (2011-11-22 07:03:47 UTC) #5
Takashi Toyoshima
OK, make sense. I must consider on win32.
9 years, 1 month ago (2011-11-22 07:27:48 UTC) #6
Takashi Toyoshima
I look into querying command lines on win32. It's not impossible but a little tricky. ...
9 years, 1 month ago (2011-11-22 08:30:49 UTC) #7
Paweł Hajdan Jr.
Have you tried a different approach first: starting the server in a process group / ...
9 years, 1 month ago (2011-11-22 09:31:57 UTC) #8
Takashi Toyoshima
Thanks, Paweł! The way you suggest looks very nice. I'll apply it to my change ...
9 years, 1 month ago (2011-11-22 11:32:25 UTC) #9
Takashi Toyoshima
I revised my change to support Win32 JobObject. Could you look into it?
9 years, 1 month ago (2011-11-22 16:30:37 UTC) #10
Paweł Hajdan Jr.
That's good direction. Some implementation comments. Bonus points for moving the code out of ui_test_utils ...
9 years, 1 month ago (2011-11-22 16:38:37 UTC) #11
Takashi Toyoshima
http://codereview.chromium.org/8633004/diff/2003/chrome/test/base/ui_test_utils.cc File chrome/test/base/ui_test_utils.cc (right): http://codereview.chromium.org/8633004/diff/2003/chrome/test/base/ui_test_utils.cc#newcode9 chrome/test/base/ui_test_utils.cc:9: #if defined(OS_WIN) On 2011/11/22 16:38:37, Paweł Hajdan Jr. wrote: ...
9 years, 1 month ago (2011-11-22 20:13:42 UTC) #12
Takashi Toyoshima
I make a separate change because this refactoring require more CC members. http://codereview.chromium.org/8667006/ So, Could ...
9 years, 1 month ago (2011-11-23 02:29:43 UTC) #13
Yuta Kitamura
Mostly lgtm except for process_handle_ issue. http://codereview.chromium.org/8633004/diff/6003/chrome/test/base/ui_test_utils.cc File chrome/test/base/ui_test_utils.cc (right): http://codereview.chromium.org/8633004/diff/6003/chrome/test/base/ui_test_utils.cc#newcode740 chrome/test/base/ui_test_utils.cc:740: OrphanedWebSocketServerFilter(std::string script_name, std::string ...
9 years, 1 month ago (2011-11-23 06:06:09 UTC) #14
Takashi Toyoshima
Thank you for review, and sorry for too many careless misses. I upload revised one ...
9 years, 1 month ago (2011-11-23 08:53:32 UTC) #15
Takashi Toyoshima
OK, I'll land 8667006 first, then land this using 8667006.
9 years, 1 month ago (2011-11-23 13:36:16 UTC) #16
Paweł Hajdan Jr.
LGTM with comments. http://codereview.chromium.org/8633004/diff/15001/chrome/test/base/ui_test_utils.cc File chrome/test/base/ui_test_utils.cc (right): http://codereview.chromium.org/8633004/diff/15001/chrome/test/base/ui_test_utils.cc#newcode738 chrome/test/base/ui_test_utils.cc:738: class OrphanedWebSocketServerFilter : public base::ProcessFilter { ...
9 years, 1 month ago (2011-11-23 17:50:41 UTC) #17
Takashi Toyoshima
http://codereview.chromium.org/8633004/diff/15001/chrome/test/base/ui_test_utils.cc File chrome/test/base/ui_test_utils.cc (right): http://codereview.chromium.org/8633004/diff/15001/chrome/test/base/ui_test_utils.cc#newcode738 chrome/test/base/ui_test_utils.cc:738: class OrphanedWebSocketServerFilter : public base::ProcessFilter { OK, I remove ...
9 years, 1 month ago (2011-11-23 23:29:43 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/toyoshim@chromium.org/8633004/14005
9 years, 1 month ago (2011-11-23 23:42:29 UTC) #19
commit-bot: I haz the power
9 years, 1 month ago (2011-11-24 01:40:53 UTC) #20
Change committed as 111473

Powered by Google App Engine
This is Rietveld 408576698