Emulate cURL CLI flags: --retry N --retry-all-errors
andresvia opened this issue · comments
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
, maybe grpcurl
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 like Failed 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:
- I know is almost impossible to keep feature parity with the real
curl
- I know this can be accomplished in other ways, I just think it would be a "nice to have" feature
Thanks!
This probably calls for the same sort of solution as added to grpcui in fullstorydev/grpcui#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.