Open andresvia opened 1 year ago
This probably calls for the same sort of solution as added to grpcui in https://github.com/fullstorydev/grpcui/pull/133.
There's even a comment on that PR (and a TODO in the code) that it's likely appropriate to port that logic into a new dial function in the grpcurl
package, which would also make it trivial to wire up a new command-line flag here to use it.
cc @dragonsinth
Yes... if timing out the dial instead of failing fast fixes this case, that seems pretty ideal.
Feature request for your consideration.
curl
does not retry by default, but it can be instructed to do so with the command line flags--retry
and--retry-all-errors
, maybegrpcurl
should do the same or something similar.Background: I'm doing a
docker run --detach --name MyApp MyApp
Followed by a
docker run --network container:MyApp fullstorydev/grpcurl 127.0.0.1:50051 MyService/MyRPC
, but I get something likeFailed to dial target host "127.0.0.1:50051": dial tcp 127.0.0.1:50051: connect: connection refused
because nor the container or the app can come up as fast as the next command/script/etc.Rather than adding an extra step to "wait for MYAPP to be ready" I rather just slap a command line flag to
grpcurl
disclaimer:
curl
Thanks!