Skip to content

Commit f9fa32c

Browse files
committed
Narrow deadlock retry exception handling
1 parent 3ab3633 commit f9fa32c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎libs/labelbox/tests/integration/conftest.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Type
88

99
import pytest
10+
from lbox.exceptions import UnprocessableEntityError
1011

1112
from labelbox import (
1213
Classification,
@@ -757,8 +758,8 @@ def live_chat_evaluation_project_with_batch(
757758
try:
758759
project = client.create_model_evaluation_project(name=project_name)
759760
break
760-
except Exception:
761-
if attempt == 2:
761+
except UnprocessableEntityError as exc:
762+
if "ER_LOCK_DEADLOCK" not in str(exc) or attempt == 2:
762763
raise
763764
time.sleep(2 * (attempt + 1))
764765

0 commit comments

Comments
 (0)