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

Log exception on database commit conflict

parent b4eb2bf8
No related branches found
No related tags found
No related merge requests found
Pipeline #7610 passed
Pipeline: backend

#7612

    ......@@ -2,6 +2,7 @@ import os
    import random
    import sys
    import time
    import traceback
    from enum import StrEnum
    from typing import Callable, TypeVar, TypeVarTuple, Sequence
    ......@@ -224,7 +225,8 @@ class Database:
    # 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", e)
    print("Warning: Reattempting transaction after commit conflict", file=sys.stderr)
    traceback.print_exception(e)
    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