Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions backend/syft_space/components/datasets/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ async def _ensure_provisioner_running(
f"not ready ({exc}), restarting..."
)
await provisioner_cls.stop(state)
await self.provisioner_state_repository.upsert_status(
# Force-reset: normal RUNNING→STOPPED transition is
# not allowed by the state machine (must go via STOPPING).
# This is a recovery path so we bypass the guards.
await self.provisioner_state_repository.force_status_update(
dtype=dtype,
status=ProvisionerStatus.STOPPED,
)
Expand All @@ -121,7 +124,10 @@ async def _ensure_provisioner_running(
f"Provisioner for '{dtype}' marked as running in DB "
f"but process is dead, restarting..."
)
await self.provisioner_state_repository.upsert_status(
# Force-reset: normal RUNNING→STOPPED transition is
# not allowed by the state machine (must go via STOPPING).
# This is a recovery path so we bypass the guards.
await self.provisioner_state_repository.force_status_update(
dtype=dtype,
status=ProvisionerStatus.STOPPED,
)
Expand Down Expand Up @@ -280,9 +286,11 @@ async def startup_all_provisioners(self) -> None:
# Use state.state as config (contains connection fields from last run)
config = state.state.copy() if state.state else {}
await self._ensure_provisioner_running(state.dtype, config)
except Exception: # nosec B110 - error already logged by provisioner
except Exception as e:
logger.exception(
f"Failed to start provisioner '{state.dtype}' during startup: {e}"
)
# Continue starting other provisioners
pass

async def shutdown_all_provisioners(self) -> None:
"""Stop all running provisioners.
Expand Down