dialohq / ocaml-grpc

gRPC library for OCaml
https://dialohq.github.io/ocaml-grpc
BSD 3-Clause "New" or "Revised" License
62 stars 9 forks source link

Grpc-lwt: fetch status code from response header #58

Closed acerone85 closed 6 months ago

acerone85 commented 6 months ago

In `Grpc_lwt.Client.call, after receiving the response, the function checks for the response status code from the headers of the request. When this is not found, the function waits to receive the trailers from the remote to infer the response status code. If the response does not include any trailer received, the function will hang.

If needed, I can provide a working example where an ocaml grpc client hangs after calling a server implemented in rust/tonic, where the handler of the service returns status code 12: Unimplemented.

The client should look for the response status code from the headers of the response (not the request). The change is done in this PR.

wokalski commented 6 months ago

@tmcgilchrist please merge at your own discretion - I am not familiar with the lwt version myself.