Add with block and fail on non-temp dial error

This guarantees that grpc requests will fail quickly
when the service is not started or does not have permission.
Without the fail on non-temp error the withblock will
cause the client to wait until the timeout before failing.

Fixes #989

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-06-14 15:08:03 -07:00
parent 6bbed2c125
commit 64bc516bbe
2 changed files with 15 additions and 11 deletions

View File

@@ -65,9 +65,11 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
}
gopts := []grpc.DialOption{
grpc.WithBlock(),
grpc.WithInsecure(),
grpc.WithTimeout(100 * time.Second),
grpc.WithDialer(dialer),
grpc.FailOnNonTempDialError(true),
}
if copts.defaultns != "" {
unary, stream := newNSInterceptors(copts.defaultns)