Stabilize tls_stress_test metrics queries under exhausted session caps
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- networking, testing-qa
Research direction
Start in tests/connections.py at get_session_metrics(), run_connection_caps_tests(), and the nested create_connections_until_exhaustion(), then inspect tests/infra/clients.py for httpx.ReadError conversion. Run tls_stress_test repeatedly through tests.sh on Azure Linux 4 and determine the intended existing-session behavior at the caps. Done means transient metrics failures no longer make the test flaky while persistent failures and active/peak/soft-cap/hard-cap assertions remain actionable.
Written by the indexing model from the issue text.
Description
Summary
tls_stress_test is intermittently failing in AL4 VMSS Virtual C while the
connection-cap scenario deliberately exhausts sessions and file descriptors.
After expected connection failures, the test performs an unguarded
GET /node/metrics through clients[0]. That request may be reset or receive
503 SessionCapExhausted, failing the whole CI job.
This has occurred on unrelated PRs and predates the PR where it was most
recently observed.
Most recent occurrence
- PR: https://github.com/microsoft/CCF/pull/8165
- Failed job:
https://github.com/microsoft/CCF/actions/runs/32135397827/job/95705417848 - Workflow/job:
Continuous Integration AL4/AL4 VMSS Virtual C - Test:
tls_stress_test - Failure path:
tests/connections.py:231 run_connection_caps_tests
tests/connections.py:176 create_connections_until_exhaustion
r = clients[0].get("/node/metrics")
tests/infra/clients.py:696
raise CCFIOException from exc
infra.clients.CCFIOException
The underlying exception was:
ConnectionResetError: [Errno 104] Connection reset by peer
httpx.ReadError: [Errno 104] Connection reset by peer
The normal VMSS Virtual C job passed on the same PR commit; only the AL4 job
failed:
- Passed:
https://github.com/microsoft/CCF/actions/runs/32135397799/job/95705418136 - Failed:
https://github.com/microsoft/CCF/actions/runs/32135397827/job/95705417848
Evidence that this is pre-existing and intermittent
The same request at tests/connections.py:176 failed with
infra.clients.CCFIOException on July 26:
- Historical job:
https://github.com/microsoft/CCF/actions/runs/30214888955/job/89827281197 - Unrelated recovery PR:
https://github.com/microsoft/CCF/pull/8092
That recovery PR did not modify tests/connections.py or the TLS/session-cap
implementation. Its preceding AL4 run passed, this run failed, and its next 11
AL4 runs passed without a change to tests/connections.py.
Related failures in the same connection-cap scenario have also returned
503 SessionCapExhausted from metrics queries:
- https://github.com/microsoft/CCF/actions/runs/30554767740/job/90912282664
- https://github.com/microsoft/CCF/actions/runs/30549183462/job/90893078340
- https://github.com/microsoft/CCF/actions/runs/30535447937/job/90847555194
The metrics request at tests/connections.py:176 dates from 2021. The loop
immediately before it already treats CCFConnectionException,
CCFIOException, and RuntimeError as expected while searching for the
session/file-descriptor limit, but the subsequent metrics request has no
equivalent handling.
Relevant code
tests/connections.pyget_session_metrics()run_connection_caps_tests()- nested
create_connections_until_exhaustion() - particularly the unguarded
clients[0].get("/node/metrics")
tests/infra/clients.py- conversion of
httpx.ReadErrortoCCFIOException
- conversion of
Investigation notes
Determine which invariant is intended:
- An already admitted session must remain usable while new sessions are
rejected. If so, the reset/503 may expose a CCF session-cap bug and the test
should retain a strict assertion. - A reset or temporary 503 is valid while the test is deliberately exhausting
file descriptors and session caps. If so, the test should explicitly wait
for cap state to settle and retry the metrics query using an appropriate
existing session, rather than failing on a timing-dependent request.
Avoid simply swallowing the exception. Preserve the assertions on active/peak
session metrics and ensure a persistent inability to query metrics still fails
with useful diagnostics.
Also check whether the test should use the existing get_session_metrics()
helper consistently rather than making a separate direct request.
Suggested validation
- Build Debug on Azure Linux 4, matching the failing workflow.
- Run
tls_stress_testrepeatedly through the repositorytests.shwrapper. - Confirm the connection-cap assertions still detect real cap regressions.
- Confirm transient reset/503 behavior no longer fails the test if it is
considered valid. - Run the complete AL4 bucket C job.
Acceptance criteria
- The intended behavior of existing sessions at the soft/hard cap is explicit
in the test. tls_stress_testis stable under repeated AL4 runs.- Persistent metrics-query failure remains actionable and fails the test.
- Session active/peak/soft-cap/hard-cap assertions are preserved.
- Dominant language
- C++
- Stars
- 874
- Forks
- 263
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 157
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/CCF
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/CCF#8184 · 1 comment ·
Maintainers usually reply within 1 day
-
Encrypt private ledger data directly into serialised entriesPossibly taken @achamayou claimed this 7 days ago. Opencrypto enhancement performance
Difficulty 5/5 Over a week Newbie friendliness 42/100
microsoft/CCF#8169 · 1 reaction · 2 assignees ·
Maintainers usually reply within 1 day
-
Hybrid (classical crypto + PQ) TLS in CCFMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
[request] vsg/1.1.16Openupstream update
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
conan-io/conan-center-index#31142 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
NVIDIA/DeepStream#78 ·