Skip to content

Commit 82c9040

Browse files
committed
refactor
1 parent 615bac9 commit 82c9040

File tree

1 file changed

+6
-3
lines changed
  • services/director-v2/src/simcore_service_director_v2/modules

1 file changed

+6
-3
lines changed

services/director-v2/src/simcore_service_director_v2/modules/dask_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,14 @@ async def _get_task_state(job_id: str) -> RunningState:
446446
if parsed_event.state == RunningState.FAILED:
447447
try:
448448
# find out if this was a cancellation
449-
var = distributed.Variable(job_id, client=self.backend.client)
450-
future: distributed.Future = await var.get(
449+
task_future: distributed.Future = (
450+
await dask_utils.wrap_client_async_routine(
451+
self.backend.client.get_dataset(name=job_id)
452+
)
453+
)
454+
exception = await task_future.exception(
451455
timeout=_DASK_DEFAULT_TIMEOUT_S
452456
)
453-
exception = await future.exception(timeout=_DASK_DEFAULT_TIMEOUT_S)
454457
assert isinstance(exception, Exception) # nosec
455458

456459
if isinstance(exception, TaskCancelledError):

0 commit comments

Comments
 (0)