From 99f7c4bb5e3e0a9bbde5c62e267cce5a1e8292d7 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 23 Jun 2020 19:11:34 -0700 Subject: [PATCH] quic: possibly resolve flaky assertion failure in ipv6only test PR-URL: https://github.com/nodejs/node/pull/34033 Reviewed-By: Anna Henningsen Reviewed-By: Jiawen Geng Reviewed-By: Daniel Bevenius --- src/quic/node_quic_session.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/quic/node_quic_session.cc b/src/quic/node_quic_session.cc index 66a05e55248b4b..eac88ff67f2e99 100644 --- a/src/quic/node_quic_session.cc +++ b/src/quic/node_quic_session.cc @@ -1663,10 +1663,8 @@ void QuicSession::AddStream(BaseObjectPtr stream) { // not immediately torn down, but is allowed to drain // properly per the QUIC spec description of "immediate close". void QuicSession::ImmediateClose() { - // Calling either ImmediateClose or SilentClose will cause - // the QUICSESSION_FLAG_CLOSING to be set. In either case, - // we should never re-enter ImmediateClose or SilentClose. - CHECK(!is_flag_set(QUICSESSION_FLAG_CLOSING)); + if (is_flag_set(QUICSESSION_FLAG_CLOSING)) + return; set_flag(QUICSESSION_FLAG_CLOSING); QuicError err = last_error(); @@ -2368,10 +2366,7 @@ void QuicSession::ResetStream(int64_t stream_id, uint64_t code) { // notify the JavaScript side and destroy the connection with // a flag set that indicates stateless reset. void QuicSession::SilentClose() { - // Calling either ImmediateClose or SilentClose will cause - // the QUICSESSION_FLAG_CLOSING to be set. In either case, - // we should never re-enter ImmediateClose or SilentClose. - CHECK(!is_flag_set(QUICSESSION_FLAG_CLOSING)); + CHECK(!is_flag_set(QUICSESSION_FLAG_SILENT_CLOSE)); set_flag(QUICSESSION_FLAG_SILENT_CLOSE); set_flag(QUICSESSION_FLAG_CLOSING);