Skip to content

Commit 53154a5

Browse files
committed
Fixed Python 3.9 CI race condition in workspace.add()
- Only apply retry loop for LiveBackend (not standalone mode) - Increased retry timeout from 2s to 5s for CI robustness
1 parent eb91035 commit 53154a5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

datalab_kernel/workspace.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,12 @@ def add(self, name: str, obj: DataObject, overwrite: bool = False) -> DataObject
810810
self._backend.add(name, obj, overwrite=overwrite)
811811
# For live backend, allow retry window for object to appear
812812
# This handles race conditions with XML-RPC (especially on Python 3.9)
813-
for _ in range(20):
814-
try:
815-
return self._backend.get(name)
816-
except KeyError:
817-
time.sleep(0.1)
813+
if isinstance(self._backend, LiveBackend):
814+
for _ in range(50): # 5 seconds total timeout
815+
try:
816+
return self._backend.get(name)
817+
except KeyError:
818+
time.sleep(0.1)
818819
return self._backend.get(name)
819820

820821
def remove(self, name: str) -> None:

0 commit comments

Comments
 (0)