Stop retrying terminal subscription errors - #895
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
For On Juniper MX, the path
But it show up as soon as an alarm is active. So if we stop retrying we would never be notified of an alarm. |
Fixes #834.
Summary
Subscribe,SubscribeChan, andSubscribeStreamChanCANCELEDstatusRetry behavior
The following canonical gRPC statuses stop the subscription retry loop:
CANCELEDINVALID_ARGUMENTNOT_FOUNDALREADY_EXISTSPERMISSION_DENIEDRESOURCE_EXHAUSTEDFAILED_PRECONDITIONOUT_OF_RANGEUNIMPLEMENTEDDATA_LOSSUNAUTHENTICATEDRESOURCE_EXHAUSTEDis treated as terminal for subscriptions as requested in #834.Transient statuses such as
DEADLINE_EXCEEDED,ABORTED, andUNAVAILABLEremain retryable.UNKNOWN,INTERNAL, and non-gRPC errors also retain the existing retry behavior for compatibility with older targets and proxies.Locally initiated cancellation remains silent, while a remote
CANCELEDstatus is reported once before the retry loop stops.Testing
go test ./target -count=1 -racego test ./... -count=1go vet ./...CGO_ENABLED=0 ./tests/run_tests.sh