Skip to content
Snippets Groups Projects
Commit 3f385f0f authored by Simon Künzel's avatar Simon Künzel
Browse files

Add warning for database conflicts

parent 3c477b21
No related branches found
No related tags found
No related merge requests found
Pipeline #7600 passed
Pipeline: backend

#7602

    ......@@ -220,9 +220,11 @@ class Database:
    if attempts >= (self._max_write_attempts if writeable else self._max_read_attempts):
    self._on_transaction_aborted_after_repeated_conflict(writeable)
    raise TransactionConflictError(e)
    # Sleep a random time for up to 500ms to increase chance that next attempt succeeds (The randomness makes
    # it more likely that we reattempt at a different time than the one with which we are in conflict right now)
    time.sleep(random.random() / 2)
    print("Warning: Reattempting transaction after commit conflict")
    continue
    raise AssertionError("This should be unreachable code")
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment