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

Support "trailers-only" responses #1

Closed
quernd opened this issue Mar 23, 2022 · 0 comments · Fixed by dialohq/ocaml-grpc-fork#5 or #7
Closed

Support "trailers-only" responses #1

quernd opened this issue Mar 23, 2022 · 0 comments · Fixed by dialohq/ocaml-grpc-fork#5 or #7

Comments

@quernd
Copy link
Collaborator

quernd commented Mar 23, 2022

This is possibly related to the hang-forever bug reported by @mbacarella in dialohq/ocaml-grpc-fork#2.

Servers can respond with an empty body and headers containing the gRPC status that would normally be packaged as trailing headers at the end of the body. E.g. if you call etcd with a non-existing method, the response is just HTTP headers:

((":status" "200")("content-type" "application/grpc")("grpc-status" "12")
("grpc-message" "unknown method This_method_is_missing"))

And the Lwt client will hang. (Status code 12 is UNIMPLEMENTED)

Confusingly, this is called "Trailers-only" in the gRPC spec.

How to fix this:

  • Check for gRPC status in the headers first
  • If they're missing, wait for trailers in the body
  • Only when both are missing, apply @mbacarella's workaround (in this case, we probably dialed a non-gRPC server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant