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 authored Jan 2, 2020
1 parent 154c8ec commit 13a870c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion firestore/google/cloud/firestore_v1/watch.py
Original file line number Diff line number Diff line change
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 13a870c

Please sign in to comment.