GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — Add a test which provokes abort-during-read during 'run_in_transaction'. by tseaver · Pull Request #3663 · googleapis/google-cloud-python Conversation
|
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@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 :param deadline: maximum timestamp to continue retrying the transaction. """ - 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): """Helper for :func:`_delay_until_retry`. :type exc: :class:`google.gax.errors.GaxError` @@ -339,7 +366,7 @@ def _get_retry_delay(exc): :rtype: float :returns: seconds to wait before retrying the transaction. """ - metadata = dict(exc.cause.trailing_metadata()) + metadata = dict(cause.trailing_metadata()) retry_info_pb = metadata.get('google.rpc.retryinfo-bin') if retry_info_pb is not None: retry_info = RetryInfo() |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Turns out my issue is the same as #3562. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ca441f7 to
f916edc
Compare
|
I've rebased, fixed the deadlock / hang, and added a separate commit (f916edc) with my workaround for #3562 so that I can verify the tests pass on Circle. I propose waiting for a real fix and then removing that commit. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The test failure is for coverage of branches added in the to-be-backed-out commit (f916edc). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tseaver once #3738 is in, you can use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tseaver I removed the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jonparrott Note that for the @bjwatson Am I still supposed to be catching |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tseaver yes, in this case catch GaxError and grpc.Call. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jonparrott Why are we not fixing the streaming iterator stuff to return only one kind of error? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tseaver we are, but it's O(weeks) away, and changing this PR to catch |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jonparrott Note that one cannot catch Given that the change is intended to be temporary, I will merge with a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
f916edc to
cf48b5e
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.