From af5fd1dabd411a67afa729d1954cb1b9edf4d619 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Thu, 2 Jan 2020 10:26:31 -0800 Subject: [PATCH] fix: recover watch stream on more error types (#9995) * fix: Recover watch stream on more error types. RST_STREAM for example is INTERNAL * fix: match recovered stream exceptions to node.js implementation, https://github.com/googleapis/nodejs-firestore/blob/25472e11a0e1a4a5e1931b1652d125f9c8cabf11/dev/src/watch.ts\#L817 --- google/cloud/firestore_v1/watch.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/google/cloud/firestore_v1/watch.py b/google/cloud/firestore_v1/watch.py index 458a3a947..2216acd45 100644 --- a/google/cloud/firestore_v1/watch.py +++ b/google/cloud/firestore_v1/watch.py @@ -57,7 +57,16 @@ "DO_NOT_USE": -1, } _RPC_ERROR_THREAD_NAME = "Thread-OnRpcTerminated" -_RECOVERABLE_STREAM_EXCEPTIONS = (exceptions.ServiceUnavailable,) +_RECOVERABLE_STREAM_EXCEPTIONS = ( + exceptions.Aborted, + exceptions.Cancelled, + exceptions.Unknown, + exceptions.DeadlineExceeded, + exceptions.ResourceExhausted, + exceptions.InternalServerError, + exceptions.ServiceUnavailable, + exceptions.Unauthenticated, +) _TERMINATING_STREAM_EXCEPTIONS = (exceptions.Cancelled,) DocTreeEntry = collections.namedtuple("DocTreeEntry", ["value", "index"])