Skip to content

Commit

Permalink
fix: recover watch stream on more error types (#9995)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
crwilcox committed Jan 2, 2020
1 parent c3864f7 commit af5fd1d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion google/cloud/firestore_v1/watch.py
Expand Up @@ -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"])
Expand Down

0 comments on commit af5fd1d

Please sign in to comment.