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

Issue 2930323002: Remove Request from Map in OnNewSpdySessionReady(). (Closed)

Created:
3 years, 6 months ago by Bence
Modified:
3 years, 6 months ago
Reviewers:
xunjieli
CC:
chromium-reviews, cbentzel+watch_chromium.org, bnc+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove Request from Map in OnNewSpdySessionReady(). SpdySessionPool::OnNewSpdySessionReady() calls HttpStreamFactoryImpl::Request::Complete() repeatedly while there are any Requests in the map. This relies on HttpStreamRequest::Delegate::OnStreamReady() destroying the Request, which in its destructor calls HttpStreamFactoryImpl::JobController::OnRequestComplete(), which calls HttpStreamFactoryImpl::JobController::CancelJobs(), which calls HttpStreamFactoryImpl::JobController::RemoveRequestFromSpdySessionRequestMap(), which calls SpdySessionPool::RemoveRequestFromSpdySessionRequestMap(). However, if HttpStreamRequest::Delegate::OnStreamReady() does not destroy the Request, that results in DCHECK(!completed_) triggering in HttpStreamFactoryImpl::Request::Complete() in a debug build, and an infinite loop in production build. This CL fixes this by explicitly calling RemoveRequestFromSpdySessionRequestMap() in SpdySessionPool::OnNewSpdySessionReady(). This revives https://crrev.com/2784143003, which was abandoned to do all the necessary cleanup first. Kudos to xunjieli@ for paving the way. BUG=706974 Review-Url: https://codereview.chromium.org/2930323002 Cr-Commit-Position: refs/heads/master@{#478704} Committed: https://chromium.googlesource.com/chromium/src/+/dcdaa5f6458c89fee3f6e2a0913707463c05171e

Patch Set 1 #

Total comments: 2

Patch Set 2 : Re: #7. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -0 lines) Patch
M net/http/http_stream_factory_impl_unittest.cc View 1 1 chunk +61 lines, -0 lines 0 comments Download
M net/spdy/chromium/spdy_session_pool.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 19 (12 generated)
Bence
xunjieli: PTAL. Thanks.
3 years, 6 months ago (2017-06-12 16:49:40 UTC) #4
xunjieli
This is great! Thank you. https://codereview.chromium.org/2930323002/diff/1/net/http/http_stream_factory_impl_unittest.cc File net/http/http_stream_factory_impl_unittest.cc (right): https://codereview.chromium.org/2930323002/diff/1/net/http/http_stream_factory_impl_unittest.cc#newcode2161 net/http/http_stream_factory_impl_unittest.cc:2161: EXPECT_EQ(1, GetSpdySessionCount(session.get())); Could you ...
3 years, 6 months ago (2017-06-12 17:09:08 UTC) #7
Bence
Thank you. PTAL. On 2017/06/12 17:09:08, xunjieli wrote: > This is great! Thank you. > ...
3 years, 6 months ago (2017-06-12 17:33:47 UTC) #9
xunjieli
lgtm
3 years, 6 months ago (2017-06-12 17:50:15 UTC) #11
Bence
Thank you. https://codereview.chromium.org/2930323002/diff/1/net/http/http_stream_factory_impl_unittest.cc File net/http/http_stream_factory_impl_unittest.cc (right): https://codereview.chromium.org/2930323002/diff/1/net/http/http_stream_factory_impl_unittest.cc#newcode2161 net/http/http_stream_factory_impl_unittest.cc:2161: EXPECT_EQ(1, GetSpdySessionCount(session.get())); On 2017/06/12 17:09:07, xunjieli wrote: ...
3 years, 6 months ago (2017-06-12 18:56:36 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2930323002/20001
3 years, 6 months ago (2017-06-12 18:57:31 UTC) #16
commit-bot: I haz the power
3 years, 6 months ago (2017-06-12 19:03:05 UTC) #19
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/dcdaa5f6458c89fee3f6e2a09137...

Powered by Google App Engine
This is Rietveld 408576698