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

Issue 394113003: Fix WebSocket race between close and connect. (Closed)

Created:
6 years, 5 months ago by Adam Rice
Modified:
6 years, 5 months ago
Reviewers:
Johnny, yhirano
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fix WebSocket race between close and connect. If the WebSocket handshake was cancelled immediately after the connect succeeded before the ClientSocketHandle was fully initialised, then the socket would not be released back to the pool, and as a result the endpoint would not be unlocked. Fix by actively reclaiming the socket in WebSocketTransportClientSocketPool::CancelRequest(). Also add a test for this condition. BUG=394268, 389084 TEST=net_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285175

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make the test actually reproduce the bug. #

Patch Set 3 : DCHECK that the handle is not initialised in CancelRequest() #

Patch Set 4 : Rebase. #

Patch Set 5 : Rebase harder. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
M net/socket/websocket_transport_client_socket_pool.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M net/socket/websocket_transport_client_socket_pool_unittest.cc View 1 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Adam Rice
6 years, 5 months ago (2014-07-17 07:33:44 UTC) #1
yhirano
https://codereview.chromium.org/394113003/diff/1/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/394113003/diff/1/net/socket/websocket_transport_client_socket_pool.cc#newcode365 net/socket/websocket_transport_client_socket_pool.cc:365: scoped_ptr<StreamSocket> socket = handle->PassSocket(); ClientSocketHandle::PassSocket says: // SetSocket() must ...
6 years, 5 months ago (2014-07-18 07:52:08 UTC) #2
Adam Rice
https://codereview.chromium.org/394113003/diff/1/net/socket/websocket_transport_client_socket_pool.cc File net/socket/websocket_transport_client_socket_pool.cc (right): https://codereview.chromium.org/394113003/diff/1/net/socket/websocket_transport_client_socket_pool.cc#newcode365 net/socket/websocket_transport_client_socket_pool.cc:365: scoped_ptr<StreamSocket> socket = handle->PassSocket(); On 2014/07/18 07:52:08, yhirano wrote: ...
6 years, 5 months ago (2014-07-18 09:08:27 UTC) #3
yhirano
lgtm
6 years, 5 months ago (2014-07-22 10:36:09 UTC) #4
Adam Rice
+jgraettinger for net OWNERS.
6 years, 5 months ago (2014-07-22 12:25:47 UTC) #5
Johnny
lgtm
6 years, 5 months ago (2014-07-23 13:27:34 UTC) #6
Adam Rice
The CQ bit was checked by ricea@chromium.org
6 years, 5 months ago (2014-07-23 14:56:22 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ricea@chromium.org/394113003/80001
6 years, 5 months ago (2014-07-23 14:57:37 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-23 18:36:44 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-23 18:56:39 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/173902)
6 years, 5 months ago (2014-07-23 18:56:40 UTC) #11
Adam Rice
The CQ bit was checked by ricea@chromium.org
6 years, 5 months ago (2014-07-24 07:35:01 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ricea@chromium.org/394113003/80001
6 years, 5 months ago (2014-07-24 07:36:59 UTC) #13
commit-bot: I haz the power
6 years, 5 months ago (2014-07-24 10:48:23 UTC) #14
Message was sent while issue was closed.
Change committed as 285175

Powered by Google App Engine
This is Rietveld 408576698