-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement _run_and_rollback_retrying #6960
Conversation
edb/testbase/connection.py
Outdated
class RawIteration(RawTransaction, Iteration): | ||
async def _ensure_transaction(self): | ||
self._started = True | ||
await super()._ensure_transaction() | ||
|
||
|
||
class Retry: | ||
def __init__(self, connection): | ||
def __init__(self, connection, raw=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should we make all our Iteration
s be RawTransaction
s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up taking a different approach that allows Iteration to always contain nested transactions, but not to be in one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this is good.
In general we should be using retrying transactions. Our isolated tests do retries at the outside, but non-isolated ones don't necessarily. Implement _run_and_rollback_retrying and use it some places that TransactionSerializationError flakes have been seen (in #6954 and in nightly CI). Honestly I don't really think that these places ought to be having TransactionSerializationErrors, but also it really is pretty required to do retries when using SERIALIZABLE, so we should start moving towards being more consistent about it.
In general we should be using retrying transactions. Our isolated tests do retries at the outside, but non-isolated ones don't necessarily. Implement _run_and_rollback_retrying and use it some places that TransactionSerializationError flakes have been seen (in #6954 and in nightly CI). Honestly I don't really think that these places ought to be having TransactionSerializationErrors, but also it really is pretty required to do retries when using SERIALIZABLE, so we should start moving towards being more consistent about it.
In general we should be using retrying transactions. Our isolated tests do retries at the outside, but non-isolated ones don't necessarily. Implement _run_and_rollback_retrying and use it some places that TransactionSerializationError flakes have been seen (in #6954 and in nightly CI). Honestly I don't really think that these places ought to be having TransactionSerializationErrors, but also it really is pretty required to do retries when using SERIALIZABLE, so we should start moving towards being more consistent about it.
In general we should be using retrying transactions. Our isolated
tests do retries at the outside, but non-isolated ones don't
necessarily.
Implement _run_and_rollback_retrying and use it some places that
TransactionSerializationError flakes have been seen (in #6954 and
in nightly CI).
Honestly I don't really think that these places ought to be having
TransactionSerializationErrors, but also it really is pretty required
to do retries when using SERIALIZABLE, so we should start moving
towards being more consistent about it.