diff --git a/doc/admin-guide/files/records.yaml.en.rst b/doc/admin-guide/files/records.yaml.en.rst index ea1f7d60a7a..b04e9450f0b 100644 --- a/doc/admin-guide/files/records.yaml.en.rst +++ b/doc/admin-guide/files/records.yaml.en.rst @@ -526,6 +526,9 @@ Network See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts. + Note that for QUIC this will be ignored and ``proxy.config.quic.no_activity_timeout_in`` + should be used instead. + .. ts:cv:: CONFIG proxy.config.net.inactivity_check_frequency INT 1 How frequent (in seconds) to check for inactive connections. If you deal @@ -4493,6 +4496,11 @@ removed in the future without prior notice. This value will be advertised as ``idle_timeout`` Transport Parameter. Transport Parameter. + .. important:: + + QUIC ignores any settings for ``proxy.config.net.default_inactivity_timeout`` and only + honors the ``proxy.config.quic.no_activity_timeout_in``. + .. ts:cv:: CONFIG proxy.config.quic.no_activity_timeout_out INT 30000 :reloadable: diff --git a/iocore/net/QUICNetVConnection_quiche.cc b/iocore/net/QUICNetVConnection_quiche.cc index df0d614b362..9b93e147e06 100644 --- a/iocore/net/QUICNetVConnection_quiche.cc +++ b/iocore/net/QUICNetVConnection_quiche.cc @@ -73,6 +73,10 @@ QUICNetVConnection::free() void QUICNetVConnection::remove_connection_ids() { + if (this->_ctable) { + this->_ctable->erase(this->_quic_connection_id, this); + this->_ctable->erase(this->_original_quic_connection_id, this); + } } // called by ET_UDP @@ -281,12 +285,14 @@ QUICNetVConnection::acceptEvent(int event, Event *e) SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_handshake); // Send this netvc to InactivityCop. + // Note: even though we will set the timeouts to 0, we need this so we make sure the one gets freed and the IO is properly ended. nh->startCop(this); + // We will take care of this by using `idle_timeout` configured by `proxy.config.quic.no_activity_timeout_in`. + this->set_default_inactivity_timeout(0); + if (inactivity_timeout_in) { - set_inactivity_timeout(inactivity_timeout_in); - } else { - set_inactivity_timeout(0); + this->set_inactivity_timeout(inactivity_timeout_in); } if (active_timeout_in) { @@ -589,9 +595,6 @@ QUICNetVConnection::_handle_interval() quiche_conn_on_timeout(this->_quiche_con); if (quiche_conn_is_closed(this->_quiche_con)) { - this->_ctable->erase(this->_quic_connection_id, this); - this->_ctable->erase(this->_original_quic_connection_id, this); - if (quiche_conn_is_timed_out(this->_quiche_con)) { QUICConDebug("QUIC Idle timeout detected"); this->thread->schedule_imm(this, VC_EVENT_INACTIVITY_TIMEOUT); diff --git a/tests/gold_tests/timeout/quic_no_activity_timeout.test.py b/tests/gold_tests/timeout/quic_no_activity_timeout.test.py index 32dadf07651..f92d96b355b 100644 --- a/tests/gold_tests/timeout/quic_no_activity_timeout.test.py +++ b/tests/gold_tests/timeout/quic_no_activity_timeout.test.py @@ -125,15 +125,11 @@ def run(self, check_for_max_idle_timeout=False): gold_file="gold/quic_no_activity_timeout.gold") test1.run(check_for_max_idle_timeout=True) -## -# The following tests is commented out as if we have a smaller default_inactivity_timeout -# happening before the configured max_idle_timeout in quiche we will end up crashing. -# The following should be uncommented once the bug is fixed. -# - -# test2 = Test_quic_no_activity_timeout( -# "Test quic ts.quic.no_activity_timeout_in(max_idle_timeout_, default_inactivity_timeout should kick in first.", -# replay_keys="delay5s", -# no_activity_timeout_in=6800, -# extra_recs={'proxy.config.net.default_inactivity_timeout': 1}) -# test2.run() +# QUIC Ignores the default_inactivity_timeout config, so the ts.quic.no_activity_timeout_in +# should be honor +test2 = Test_quic_no_activity_timeout( + "Ignoring default_inactivity_timeout and use the ts.quic.no_activity_timeout_in instead", + replay_keys="delay5s", + no_activity_timeout_in=3000, + extra_recs={'proxy.config.net.default_inactivity_timeout': 1}) +test2.run(check_for_max_idle_timeout=True)