-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
caddyhttp: Fix HTTP/3 breaking after reload #4413
caddyhttp: Fix HTTP/3 breaking after reload #4413
Conversation
|
Ah, interesting. I don't seem to remember that being the case before, so that's good news. (Or if it was, I just made a dumb. But I swear this used to work, so. Anyway I'm not complaining. The best fixes delete code.) Thanks for the PR! Will review this shortly. |
@marten-seemann does this make sense to you? |
I feel like I'm missing context here. What do you mean by "as they already closing in lucas-clemente/[email protected]/http3/server.go L:413"? That would be |
@marten-seemann the issue this is meant to solve is #4348 I'll update the PR description/title. |
How does this reload work? Do you restart the QUIC server after the new config has been applied? |
@marten-seemann during a reload, the old server is kept up, and a new one is created to replace it, and finally the old server will be torn down if the new one started without error. So two servers will be running concurrently for a moment. There's a more thorough explanation of Caddy's architecture here, to bring you back up to speed on this https://caddyserver.com/docs/architecture |
I'm not sure. Running them concurrently is ok, but you need to close the old server somehow, don't you? |
Here's a context summary, fwiw: #2727 - HTTP3 implemented. There is trouble with reloading, relating to closing / recreating servers, listeners with quic-go quic-go/quic-go#2111 - @marten-seemann attempts to fix an issue with quic-go, making its multiplexer recognise conns by their local address string, instead of struct equality. #2727 comment from @mholt just before merge (Sept 2019) - "the issue persists, but by not closing the http3.Server, the issue is either resolved or it hides itself." So it's merged, with h3 listeners being closed. A loop to close h3 servers is commented out. 18 Feb 2020, @mholt restores the loop that closes h3 servers. This diff, surrounding comments probably most salient for context. #4348, "http/3 stops working after reload" filed 12 Sep 2021. Leading to this PR |
Could it be related to quic-go/quic-go#2111 preventing the new listener from starting? |
@vladbondarenko Thanks for looking into this. When you do reloads, you should see some logs like:
where |
The mentioned commit happened on tag v2.0.0-beta.15 and seems to go on par with what I wrote in #4348 (comment):
So I went and checked all the Thus, I redid my testing:
Commit 0279a57 between v2.2.0-rc.1...v2.2.0-rc.2 updated Could this be, perhaps, somewhat related to the Go version bump from |
Interesting. Thanks for the detective work. I am not sure what the upgrade from Go 1.14 to Go 1.15 would have done to affect that... |
@vladbondarenko Can you confirm that the counter doesn't increase? |
Unfortunately this is still an issue for me. Is there anything needed before this can get merged? |
We need confirmation that it does work and that the counter doesn't increase, indicating a leak. |
I will look into this and get back to you guys. |
I ran some tests and this PR indeed creates a leak. It seems like that the
I did observe that when using |
Thanks for verifying that @ChrisLahaye . Sounds like we'll need a way to shut down the HTTP/3 server without closing the socket for others who may be using it. |
I'm going to close this PR for now as it seems like it may be going inactive, and it has been confirmed that it's not a viable fix. Please feel welcome to continue discussion though if needed, although perhaps that is more relevant in the original issue unless it's about this change specifically. Thanks! |
Fixes #4348
Disabling extra closing http3 listeners.