Skip to content

Commit 17bbd9e

Browse files
committed
worker does not allow for async call into log_event
1 parent 3997e5b commit 17bbd9e

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

services/dask-sidecar/src/simcore_service_dask_sidecar/utils/dask.py

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

88
import distributed
9-
from common_library.async_tools import maybe_await
109
from dask_task_models_library.container_tasks.errors import TaskCancelledError
1110
from dask_task_models_library.container_tasks.events import (
1211
BaseTaskEvent,
@@ -75,7 +74,6 @@ def publish_progress(self, report: ProgressReport) -> None:
7574
if rounded_value > self._last_published_progress_value:
7675
with log_catch(logger=_logger, reraise=False):
7776
publish_event(
78-
self.progress,
7977
TaskProgressEvent.from_dask_worker(
8078
progress=rounded_value, task_owner=self.task_owner
8179
),
@@ -170,7 +168,7 @@ async def periodicaly_check_if_aborted(task_name: str) -> None:
170168
await periodically_checking_task
171169

172170

173-
async def publish_event(
171+
def publish_event(
174172
event: BaseTaskEvent,
175173
) -> None:
176174
"""never reraises, only CancellationError"""
@@ -180,6 +178,4 @@ async def publish_event(
180178
log_catch(_logger, reraise=False),
181179
log_context(_logger, logging.DEBUG, msg=f"publishing {event=}"),
182180
):
183-
await maybe_await(
184-
worker.log_event(TaskProgressEvent.topic_name(), event.model_dump_json())
185-
)
181+
worker.log_event(TaskProgressEvent.topic_name(), event.model_dump_json())

services/dask-sidecar/tests/unit/test_utils_dask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _worker_task() -> int:
7575

7676
async def _() -> int:
7777
with log_context(logging.INFO, "_worker_task_async"):
78-
await publish_event(event_to_publish)
78+
publish_event(event_to_publish)
7979
return 2
8080

8181
return asyncio.run(_())

0 commit comments

Comments
 (0)