Skip to content
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

cohttp-eio: Don't blow up in Server.callback on client disconnections. #1015

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

mefyl
Copy link
Contributor

@mefyl mefyl commented Jan 23, 2024

My previous fix on this fixed the issue for Server.run, but not Server.callback.

cohttp-eio/src/server.ml Outdated Show resolved Hide resolved
Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub won't let me click Submit review unless I write something here.

@mefyl mefyl requested a review from talex5 January 26, 2024 12:45
Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

It might be nice to add a test for connection reset errors. The old cohttp-eio had some tests where you could inject errors (though it only tried with End_of_file), but it looks like they got removed in the rewrite: https://github.com/mirage/ocaml-cohttp/blob/b7182a17e9769c7d08c5b05e2512e0eca605f74e/cohttp-eio/tests/server.md#tests

@mseri
Copy link
Collaborator

mseri commented Feb 1, 2024

@mefyl do you think you have time to add some tests or we should better merge and open an issue about that?

@mefyl
Copy link
Contributor Author

mefyl commented Feb 1, 2024

@mefyl do you think you have time to add some tests or we should better merge and open an issue about that?

Not right now unfortunately, I might be able to look into this in a week or two. I think we should merge this in the meantime as it is a fairly crippling bug on busy servers.

@mseri mseri merged commit 02db4b4 into mirage:master Feb 1, 2024
15 of 19 checks passed
@mseri
Copy link
Collaborator

mseri commented Feb 1, 2024

Thanks

avsm added a commit to avsm/opam-repository that referenced this pull request Nov 21, 2024
CHANGES:

- bump minimum dune version to 3.8 (@avsm)
- cohttp-eio: Use system authenticator in example.
- http, cohttp: remove the scheme field from requests. This means that
  [Request.uri] no longer returns the same URI as was to create the request
  with [Request.make] (@rgrinberg 1086)
- cohttp-eio: Remove unused `Client_intf` module (talex5 mirage/ocaml-cohttp#1081)
- cohttp-eio: Make server response type abstract and allow streaming in cohttp-eio (talex5 mirage/ocaml-cohttp#1024)
- cohttp-{lwt,eio}: server: add connection header to response if not present (ushitora-anqou mirage/ocaml-cohttp#1025)
- cohttp-curl: Curl no longer prepends the first HTTP request header to the output. (jonahbeckford mirage/ocaml-cohttp#1030, mirage/ocaml-cohttp#987)
- cohttp-eio: client: use permissive argument type for make_generic
- cohttp-eio: Improve error handling in example server (talex5 mirage/ocaml-cohttp#1023)
- cohttp-eio: Don't blow up `Server.callback` on client disconnections. (mefyl mirage/ocaml-cohttp#1015)
- http: Fix assertion in `Source.to_string_trim` when `pos <> 0` (mefyl mirage/ocaml-cohttp#1017)
- cohttp: `Cohttp.Request.make_for_client` no longer allows setting both
  `~chunked:true` and `~body_length`.
- cohttp-lwt-unix: Don't blow up when certificates are not available and no-network requests are made. (akuhlens mirage/ocaml-cohttp#1027)
  + Makes `cohttp-lwt.S.default_ctx` lazy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants