• Bence Béky's avatar
    Avoid DCHECK on SpdySessionPool destruction. · 3ba8c339
    Bence Béky authored
    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: default avatarHelen Li <xunjieli@chromium.org>
    Commit-Queue: Bence Béky <bnc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#523186}
    3ba8c339
spdy_session_pool.cc 20.4 KB