Commit f29ee62e authored by rch's avatar rch Committed by Commit bot

Fix a bug when a QUIC session is closed during the call to InitializeSession....

Fix a bug when a QUIC session is closed during the call to InitializeSession. This seems to be able to happen if too much time elapses between the call to the constructor and the call to InitializeSession.

Also adds a histogram to monitor the frequency of this situation.

BUG=399147

Review URL: https://codereview.chromium.org/560913002

Cr-Commit-Position: refs/heads/master@{#294425}
parent 339a17f9
......@@ -893,9 +893,17 @@ int QuicStreamFactory::CreateSession(
server_info.Pass(), config,
base::MessageLoop::current()->message_loop_proxy().get(),
net_log.net_log());
all_sessions_[*session] = server_id; // owning pointer
(*session)->InitializeSession(server_id, &crypto_config_,
quic_crypto_client_stream_factory_);
all_sessions_[*session] = server_id; // owning pointer
bool closed_during_initialize = !ContainsKey(all_sessions_, *session);
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession",
closed_during_initialize);
if (closed_during_initialize) {
DLOG(DFATAL) << "Session closed during initialize";
*session = NULL;
return ERR_CONNECTION_CLOSED;
}
return OK;
}
......
......@@ -16452,6 +16452,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Net.QuicSession.ClosedDuringInitializeSession">
<owner>rch@chromium.org</owner>
<summary>
True if the QUIC session is closed during the call to InitializeSession,
logged for each session just after InitializeSession is called.
</summary>
</histogram>
<histogram name="Net.QuicSession.CloseSessionOnError" enum="NetErrorCodes">
<owner>rch@chromium.org</owner>
<summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment