Avoid DCHECK on SpdySessionPool destruction.
It is possible that a DCHECK in SpdySession::DcheckDraining() is triggered when SpdySessionPool destructor call SpdySessionPool::RemoveUnavailableSession() which destroys the SpdySession, if the SpdySession is in STATE_GOING_AWAY. One way for this is that on certain platforms, SpdySessionPool::OnIPAddressChanged() may leave a SpdySession with an active stream in STATE_GOING_AWAY. Another possible way is receiving a "graceful GOAWAY" from the server, which also puts a SpdySession with active streams in STATE_GOING_AWAY. Patch set 1 introduces two unit tests, one for each of the above scenarios, that trigger this DCHECK. See trybot outputs for failing tests. Patch set 2 fixes the bug by ensuring in SpdySessionPool::CloseAllSessions() that every owned SpdySession is draining, even if there are no currently active sessions. This method is not only called by SpdySessionPool destructor, but also by HttpNetworkSession destructor (also adding a TODO for that). Also include build/build_config.h for OS_ANDROID, OS_WIN, OS_IOS macros. Bug: 789791 Change-Id: Idc3e2350b2ac6354be5c5e6b32ea8e0227f3e2d6 Reviewed-on: https://chromium-review.googlesource.com/810889Reviewed-by:Helen Li <xunjieli@chromium.org> Commit-Queue: Bence Béky <bnc@chromium.org> Cr-Commit-Position: refs/heads/master@{#523186}
Showing
Please register or sign in to comment