Uh oh!
There was an error while loading. Please reload this page.
Add a test which provokes abort-during-read during 'run_in_transaction'. - #3663
Conversation
|
tseaver
commented
Jul 25, 2017
@dhermes, @bjwatson, @lukesneeringer OK, I have the test passing, but to do so I have to straddle the fact that the GAPIC / gRPC bits sometimes raise a Specifics:
My hack to get the read-abort bit passing: @@ -312,7+334,12 @@ def_delay_until_retry(exc, deadline):
:type deadline: float
:paramdeadline: maximumtimestamptocontinueretryingthetransaction.
"""- if exc_to_code(exc.cause) != StatusCode.ABORTED:+ if isinstance(exc, GrpcRendezvous):+ cause = exc+ else:+ cause = exc.cause++ if exc_to_code(cause) != StatusCode.ABORTED: raise now = time.time()@@ -320,7 +347,7 @@ def _delay_until_retry(exc, deadline): if now >= deadline: raise- delay = _get_retry_delay(exc)+ delay = _get_retry_delay(cause) if delay is not None: if now + delay > deadline:@@ -330,7 +357,7 @@ def _delay_until_retry(exc, deadline): # pylint: enable=misplaced-bare-raise-def _get_retry_delay(exc):+def _get_retry_delay(cause): """Helperfor :func:`_delay_until_retry`.
:typeexc: :class:`google.gax.errors.GaxError`
@@ -339,7+366,7 @@ def_get_retry_delay(exc):
:rtype: float
:returns: secondstowaitbeforeretryingthetransaction.
"""
-metadata=dict(exc.cause.trailing_metadata())
+metadata=dict(cause.trailing_metadata())
retry_info_pb=metadata.get('google.rpc.retryinfo-bin')
ifretry_info_pbisnotNone:
retry_info=RetryInfo() |
tseaver
commented
Jul 25, 2017
Turns out my issue is the same as #3562. |
ca441f7 to
f916edcComparetseaver
commented
Jul 28, 2017
tseaver
commented
Jul 28, 2017
The test failure is for coverage of branches added in the to-be-backed-out commit (f916edc). |
theacodes
commented
Aug 7, 2017
bjwatson
commented
Aug 8, 2017
@tseaver I removed the |
tseaver
commented
Aug 8, 2017
@jonparrott Note that for the @bjwatson Am I still supposed to be catching |
theacodes
commented
Aug 8, 2017
@tseaver yes, in this case catch GaxError and grpc.Call. |
tseaver
commented
Aug 8, 2017
@jonparrott Why are we not fixing the streaming iterator stuff to return only one kind of error? |
theacodes
commented
Aug 8, 2017
@tseaver we are, but it's O(weeks) away, and changing this PR to catch |
tseaver
commented
Aug 9, 2017
@jonparrott Note that one cannot catch Given that the change is intended to be temporary, I will merge with a |
f916edc to
cf48b5eCompare
Uses #3615 as a base. ca441f7 is the only change from that PR.