-
Notifications
You must be signed in to change notification settings - Fork 9
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
server crashes when the client disconnects unexpectedly #34
Comments
Thanks for reporting this. I haven't yet been able to reproduce it; what are the exact steps to trigger this error? Just Ctrl-C the client during a streaming call? Since this exception is not caught by Gluten: which specific version of Gluten are you using? There have been a couple of commits recently in the Gluten main branch that affect exception handling. |
I'm using the latest. I tried downgrading to a version before those changes were introduced, but had trouble finding a set of commits across h2-eio and gluten and a few other deps in my project that were compatible. Which versions are you building with? |
I was just able to get it to build. I had to downgrade Eio to 0.10, along with gluten=0.4.1 and h2=0.10.0. Just tested with those and no longer see the error on disconnection. |
As far as the server itself shutting down, this seems to be my misunderstanding of the lifetime of the new switch argument provided to fun socket addr ->
Eio.Switch.run (fun sw ->
H2_eio.Server.create_connection_handler ~sw ?config:None
~request_handler ~error_handler addr socket) But I'm new to eio and not sure that's correct. |
I hit another case which I'm not sure yet is related to the recent gluten changes. I have to try to reproduce it in the reduced version with the older versions. I am now trying to terminate the server while the client is querying in a loop. What I see is the error handler gets called with |
I added some traces and looks like the code hangs in |
I experimented with this here and it does fix the hanging: main...joprice:ocaml-grpc:clientErrors. |
Yeah, it can be tricky to find a set of dependency versions that work together. That's mostly because there isn't yet a version of H2 on OPAM that works with Eio 0.11. We enforced an upper bound in this commit but that's just for the examples, it seems. In any case, if that error doesn't present with gluten 0.4.1, it may be worth opening an issue in the gluten repository to ask for clarification if this behavior is intended. Another thing that would be good to know is: are you able to reproduce the error only in conjunction with gRPC? From the backtrace you posted it looks to me like it would happen with any HTTP2 connection. |
That looks reasonable! Would you mind opening a PR? |
@quernd lost track of the in my inbox. I can put up a pr. |
I'm running the EIO server and client examples, and noticed that when I kill the client, the server crashes with the following error:
I'm not sure if I'm missing somewhere I'm intended to handle this, or whether connection handling should be set up a different way to be more resilient, or if this is unexpected behavior.
The text was updated successfully, but these errors were encountered: