Repository navigation
Conversation
Prevent further calls into an nghttp2 session once a fatal error was returned. Use in our HTTP/2 filters.
|
@cmeister2 would appreciate if you could throw this one into your grinder. Thanks! |
|
This is a really nice change! Centralizing the fatal-session contract in a small shim is much cleaner and more robust than trying to quarantine a broken session at every caller. I ran
So this fixes the concrete post-fatal sequences we found ( There is one gap I think we should close before calling the session boundary complete.
I also found these remaining raw session calls in callbacks, which bypass
Those look lower risk than the ignored With those covered, this looks like an excellent replacement for #23397. I would also love to retain/port its |
|
Ignoring the return value of a shimmed call is fine, imo. |
Route the remaining session operations in HTTP/2 callbacks through the nghttp2 shim so a fatal session cannot be reused. Add a regression test for starting a fresh transfer after a fatal CONTINUATION error.
|
Analysis of PR #23504 at 0f0f8ce7: Test ../../tests/http/test_32_ftps_vsftpd.py::TestFtpsVsFTPD::test_32_04_download_10_parallel[data-1m] failed, but it has been 0.2% flaky lately, so it's probably NOT a fault of the PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Note that this CI job has had a number of other flaky tests recently (4, to be specific) so it may be that this failure is rather a systemic issue with this job and not with this specific PR. Generated by Testclutch |
There was a problem hiding this comment.
🟡 Changes recommended
Cached fatal errors can remain unreported in receive and proxy egress paths, potentially stalling transfers.
2 open issues
What changed in this PR
Adds an nghttp2 shim to prevent further session calls after fatal errors in curl’s HTTP/2 filters.
Changes:
- Tracks fatal session errors and guards subsequent calls.
- Migrates HTTP/2 and proxy filters to the shim.
- Adds a regression test for a fatal error followed by a successful transfer.
| File | Description |
|---|---|
| tests/data/test1717 | Tests fatal CONTINUATION handling and a subsequent transfer. |
| tests/data/Makefile.am | Registers the regression test. |
| lib/ngh2_shim.h | Declares guarded session interfaces. |
| lib/ngh2_shim.c | Implements fatal-error tracking and guards. |
| lib/Makefile.inc | Registers shim source and header. |
| lib/http2.c | Uses the shim for HTTP/2 sessions. |
| lib/cf-h2-proxy.c | Uses the shim for HTTP/2 proxy sessions. |
Review effort: Balanced
- recheck fatal state after nghttp2 send/recv calls that may involve callbacks - http2.c/cf-h2-proxy.c check fatal state after egress loop
|
@cmeister2 from my view it's ready for merge if it survives your torture chamber. |
|
@vszakats care to merge this? |
|
Thanks to all, merged now! |

Prevent further calls into an nghttp2 session once a fatal error was returned. Use in our HTTP/2 filters.