Chromium Code Reviews
DescriptionClean 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 #
Messages
Total messages: 14 (10 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||