Go - TRANSIENT_FAILURE and FailOnNonTempDialError

63 views
Skip to first unread message

Amit Saha

unread,
Jul 22, 2021, 4:22:19 AM7/22/21
to grpc.io
Hi all - is it correct to say that what's considered a transient
failure (in the context of Wait For Ready semantics [1]) is also
what's considered a temporary error when using the grpc.WithBlock()
DialOption?

Also, is there any documentation around what's considered a temporary
failure and/or transient failure? As of now, the only definitive
reference seems to be all the error types implementing the Temporary()
method and the value that it returns.

// internal/transport/http2_client.go

func isTemporary(err error) bool {
switch err := err.(type) {
case interface {
Temporary() bool
}:
return err.Temporary()
case interface {
Timeout() bool
}:
// Timeouts may be resolved upon retry, and are thus treated as
// temporary.
return err.Timeout()
}
return true
}

[1] https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md

Menghan Li

unread,
Jul 29, 2021, 2:02:52 PM7/29/21
to grpc.io
This check is only applied to the connection errors (specifically errors return from a custom dialer, or from creds handshake).
Errors are non temporary by default. You can make it implement the interface and return true.

It has nothing to do with wait-for-ready. And it only applies to the errors during the initial Dial, as mentioned in the godoc:
Reply all
Reply to author
Forward
0 new messages