Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions iocore/net/QUICNetVConnection_quiche.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ QUICNetVConnection::state_handshake(int event, Event *data)
this->closed = 1;
break;
default:
QUICConDebug("Unhandleed event: %d", event);
QUICConDebug("Unhandled event: %d", event);
break;
}

Expand Down Expand Up @@ -180,7 +180,7 @@ QUICNetVConnection::state_established(int event, Event *data)
this->closed = 1;
break;
default:
QUICConDebug("Unhandleed event: %d", event);
QUICConDebug("Unhandled event: %d", event);
break;
}
return EVENT_DONE;
Expand Down Expand Up @@ -593,6 +593,7 @@ QUICNetVConnection::_handle_interval()
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);
return;
}
Expand Down
3 changes: 3 additions & 0 deletions tests/gold_tests/timeout/gold/quic_no_activity_timeout.gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
``
``Poll timed out waiting to read HTTP/3 content.
``
139 changes: 139 additions & 0 deletions tests/gold_tests/timeout/quic_no_activity_timeout.test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Test.Summary = 'Basic checks on QUIC max_idle_timeout set by ts.quic.no_activity_timeout_in'


Test.SkipUnless(
Condition.HasATSFeature('TS_HAS_QUICHE'),
Condition.HasCurlFeature('http3')
)


class Test_quic_no_activity_timeout:
"""Configure a test for QUIC no_activity_timeout_in."""

replay_file = "replay/quic_no_activity_timeout.replay.yaml"
client_counter: int = 0
ts_counter: int = 0
server_counter: int = 0

def __init__(self, name: str, no_activity_timeout_in=1000, gold_file="", replay_keys="", extra_recs=None):
"""Initialize the test.

:param name: The name of the test.
:param no_activity_timeout_in: Configuration value for ts.quic.no_activity_timeout_in
:param gold_file: Gold file to be checked.
:param replay_keys: Keys to be used by pv
:param extra_recs: Any additional records to be set, either a yaml string or a dict.
"""
self.name = name
self.no_activity_timeout_in = no_activity_timeout_in
self.gold_file = gold_file
self.replay_keys = replay_keys
self.extra_recs = extra_recs

def _configure_server(self, tr: 'TestRun'):
"""Configure the server.

:param tr: The TestRun object to associate the server process with.
"""
server = tr.AddVerifierServerProcess(
f"server_{Test_quic_no_activity_timeout.server_counter}",
self.replay_file)
Test_quic_no_activity_timeout.server_counter += 1
self._server = server

def _configure_traffic_server(self, tr: 'TestRun'):
"""Configure Traffic Server.

:param tr: The TestRun object to associate the ts process with.
"""
ts = tr.MakeATSProcess(f"ts-{Test_quic_no_activity_timeout.ts_counter}", enable_quic=True, enable_tls=True)

Test_quic_no_activity_timeout.ts_counter += 1
self._ts = ts
self._ts.addSSLfile("ssl/cert.crt")
self._ts.addSSLfile("ssl/private-key.key")
self._ts.Disk.records_config.update({
'proxy.config.diags.debug.enabled': 1,
'proxy.config.diags.debug.tags': 'ssl|net|v_quic|quic|http|socket|inactivity_cop',
'proxy.config.quic.no_activity_timeout_in': self.no_activity_timeout_in,
'proxy.config.quic.qlog.file_base': f'log/qlog_{Test_quic_no_activity_timeout.server_counter}',
})

if self.extra_recs:
self._ts.Disk.records_config.update(self.extra_recs)

self._ts.Disk.remap_config.AddLine(f'map / http://127.0.0.1:{self._server.Variables.http_port}')
self._ts.Disk.ssl_multicert_config.AddLine(
f'dest_ip=* ssl_cert_name={self._ts.Variables.SSLDir}/cert.crt ssl_key_name={self._ts.Variables.SSLDir}/private-key.key'
)

def run(self, check_for_max_idle_timeout=False):
"""Run the test."""
tr = Test.AddTestRun(self.name)
self._configure_server(tr)
self._configure_traffic_server(tr)

tr.Processes.Default.StartBefore(self._server)
tr.Processes.Default.StartBefore(self._ts)

tr.AddVerifierClientProcess(
f'client-{Test_quic_no_activity_timeout.client_counter}',
self.replay_file,
http3_ports=[self._ts.Variables.ssl_port],
keys=self.replay_keys)
Test_quic_no_activity_timeout.client_counter += 1

if check_for_max_idle_timeout:
tr.Processes.Default.ReturnCode = 1 # timeout
self._ts.Disk.traffic_out.All = Testers.IncludesExpression(
"QUIC Idle timeout detected", "We should detect the timeout.")
else:
tr.Processes.Default.ReturnCode = 0

if self.gold_file:
tr.Processes.Default.Streams.all = self.gold_file

# Tests start.


test0 = Test_quic_no_activity_timeout(
"Test ts.quic.no_activity_timeout_in(quic max_idle_timeout), no delays",
no_activity_timeout_in=0, # no timeout `max_idle_timeout`
replay_keys="nodelays")
test0.run()

test1 = Test_quic_no_activity_timeout(
"Test ts.quic.no_activity_timeout_in(quic max_idle_timeout) with a 5s delay",
no_activity_timeout_in=3000, # 3s `max_idle_timeout`
replay_keys="delay5s",
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()
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

meta:
version: "1.0"

sessions:
- protocol:
- name: http
version: 3
- name: tls
sni: test_sni
transactions:

- client-request:
version: "3"
headers:
fields:
- [ Content-Length, 0 ]
- [:method, GET]
- [:scheme, https]
- [:authority, example.com]
- [:path, /path/test1]
- [ uuid, nodelays ]
server-response:
status: 200
reason: "OK"
headers:
fields:
- [ Content-Length, 20 ]

proxy-response:
status: 200

- client-request:
delay: 5s
version: "3"
headers:
fields:
- [ Content-Length, 0 ]
- [:method, GET]
- [:scheme, https]
- [:authority, example.com]
- [:path, /path/test2]
- [ uuid, delay5s ]
server-response:
status: 200
reason: "OK"
headers:
fields:
- [ Content-Length, 20 ]

proxy-response:
status: 200

- client-request:
delay: 1500ms
version: "3"
headers:
fields:
- [ Content-Length, 0 ]
- [:method, GET]
- [:scheme, https]
- [:authority, example.com]
- [:path, /path/test3]
- [ uuid, delay1500ms ]
server-response:
status: 200
reason: "OK"
headers:
fields:
- [ Content-Length, 20 ]

proxy-response:
status: 200



33 changes: 33 additions & 0 deletions tests/gold_tests/timeout/ssl/cert.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIFoDCCA4igAwIBAgIUPWkE7mLk4qWFS6dxtSaFDRdjAm4wDQYJKoZIhvcNAQEL
BQAwZzELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1Nb3VudGFp
biBWaWV3MRcwFQYDVQQKDA5UcmFmZmljIFNlcnZlcjEaMBgGA1UEAwwRdHJhZmZp
Y3NlcnZlci5vcm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HTlrVcuu+12XQ05bpwS
X2RdVSMj2FzjuOB1OTAMBpFl8hrLN1p5vTpIJ0x/Zx5Ks2YaR/KmF5In8/vPNbIr
ZHVfnLSgg/X+1dtN1LVnue+kQbuc7OlzJpwfmQjA4BYzAb0fbf+IM7E6MfEzT/kB
AChW3WF9eviyklOV0qZlRLDwrQLIT+oLsJNkX7OWFpVrpXrOLj4hYf2N7zxGHxYJ
g9NkmZOTJ4maXEpzNZaewpuIW4ldZccGchwhSX0daaoVmqYSVXjfRaCpRcb0mrPR
oj9x0Jj17v4G3FoyaOoW1DEAZwjFj8r7WaauGagQqBq0kflItrIRjzI+MlJkX3QS
0AKedEllbCpSe5VJcHlaR7K3y9w3hQTKlN4Im6M8eDJ+qxYURbDLE2cHBuaYkI9Q
aZcojBYSRA++fmmS5805CqKrhCCZbORI5zqBoB6iFUG1z+dwdpygDMpuH0bbXwQ1
mp4S8GRKtTeJ2y2aFw/i/Wi/Qs8nAbQlSc6ei+oWT9ywdvkCFfdcsP+2LrWVVN3w
wAl26S08x9pZPI5kAvIG0DllSXYf65V3YXdzPoZ78igobWzfszAZ6OxfDQgkewfp
h4OSYKHBl3Jfe/Q9B8PcmgW0ikKGcquxFg3hvlMc0GZ/fVqUu++X+9Vb+QtMgyjJ
y4ybug==
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions tests/gold_tests/timeout/ssl/private-key.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDclB9kHbDNxbhB
km2b/xmReCU9nucyHZY9AJaG76Q57RgLhngEKUQS6wMlsaGwgWxKmL6l6NUF0w3X
ngcfX0YjoR5AQtTjDD+XCfc3c6Nf412eQOFlwE2sXF+lXZsp8bqBy6ckGYOdOIxY
AR5KZGA9DwqAdmkNroRNjvKEkFVZCNBMciS8qu5n3am5f9MCnPFyz4fV7QU0m5hC
5sALgshbrbGBnL/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