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

Issue 2622193003: Clean up HttpStreamFactoryImpl::JobController when Impl::Jobs complete (Closed)

Created:
3 years, 11 months ago by xunjieli
Modified:
3 years, 11 months ago
Reviewers:
Zhongyi Shi, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, Ryan Hamilton
Target Ref:
refs/pending/branch-heads/2924
Project:
chromium
Visibility:
Public.

Description

Clean up HttpStreamFactoryImpl::JobController when Impl::Jobs complete Background: When a server advertises alternative services support, JobController creates two Jobs (|main_job_| and |alternative_job_|). The controller blocks |main_job_| when connecting the |alternative_job_|. It resumes the |main_job_| when |alternative_job_| fails or when the timeout happens. When both jobs are destroyed, the JobController goes away. Bug: We currently leak JobController in the situation where |alternative_job_| succeeds and |main_job_| is blocked on alt job. OnRequestComplete() will be called which then destroys the alt job but not the main job. This causes MaybeNotifyFactoryOfCompletion() to not clean up the controller. Fix: This CL fixes this leak by resetting |main_job_| if it is blocked (i.e. hasn't started connecting) when |alternative_job_| succeeds. This CL adds a regression test for this. Note that there is no leak when orphaned job completes, because "job_bound_ && bound_job_ != job" will evaluate to true. This CL adds a |!request_| check so it's obvious that we always clean up controller in the orphaned case. This CL adds a test to confirm that we did clean up controller when orphaned job completes (which passes with and without the change). TBR=zhongyi@chromium.org TBR=mmenke@chromium.org NOTRY=true NOPRESUBMIT=true BUG=678768 Review-Url: https://codereview.chromium.org/2619583002 Cr-Commit-Position: refs/heads/master@{#442556} (cherry picked from commit e368398a3a5357a8742f3829ef08cc45080fb808) Review-Url: https://codereview.chromium.org/2622193003 Cr-Commit-Position: refs/branch-heads/2924@{#733} Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059} Committed: https://chromium.googlesource.com/chromium/src/+/1c7375269bc6e2ef192b74dd1b17f7e4e8b5f63e

Patch Set 1 #

Patch Set 2 : resolve merge conflict #

Patch Set 3 : one more merge conflict #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -11 lines) Patch
M net/http/http_basic_stream.cc View 1 chunk +5 lines, -1 line 0 comments Download
M net/http/http_stream_factory_impl_job_controller.h View 2 chunks +5 lines, -1 line 0 comments Download
M net/http/http_stream_factory_impl_job_controller.cc View 11 chunks +24 lines, -9 lines 0 comments Download
M net/http/http_stream_factory_impl_job_controller_unittest.cc View 1 2 1 chunk +120 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (10 generated)
xunjieli
Hi Cherie and Matt, This is to merge the fix into M56. I have TBR-ed ...
3 years, 11 months ago (2017-01-11 15:24:33 UTC) #3
xunjieli
net_unittests are passing. I am checking this in. There is one minor merge conflict due ...
3 years, 11 months ago (2017-01-11 15:56:09 UTC) #4
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/2622193003/40001
3 years, 11 months ago (2017-01-11 16:06:33 UTC) #11
commit-bot: I haz the power
3 years, 11 months ago (2017-01-11 16:14:00 UTC) #14
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/1c7375269bc6e2ef192b74dd1b17...

Powered by Google App Engine
This is Rietveld 408576698