Skip to content

Commit 2d76802

Browse files
fix abort
1 parent 7c599bf commit 2d76802

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

services/storage/src/simcore_service_storage/modules/celery/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from .models import (
1818
TaskContext,
19+
TaskID,
1920
TaskMetadata,
2021
TaskMetadataStore,
2122
TaskState,
@@ -78,16 +79,18 @@ async def send_task(
7879
await self._task_store.set(task_id, task_metadata, expiry=expiry)
7980
return task_uuid
8081

81-
@staticmethod
8282
@make_async()
83-
def abort_task(task_context: TaskContext, task_uuid: TaskUUID) -> None:
83+
def _abort_task(self, task_id: TaskID) -> None:
84+
AbortableAsyncResult(task_id, app=self._celery_app).abort()
85+
86+
async def abort_task(self, task_context: TaskContext, task_uuid: TaskUUID) -> None:
8487
with log_context(
8588
_logger,
8689
logging.DEBUG,
8790
msg=f"Abort task: {task_context=} {task_uuid=}",
8891
):
8992
task_id = build_task_id(task_context, task_uuid)
90-
AbortableAsyncResult(task_id).abort()
93+
return await self._abort_task(task_id)
9194

9295
async def get_task_result(
9396
self, task_context: TaskContext, task_uuid: TaskUUID

services/storage/tests/unit/test_async_jobs.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,7 @@ async def test_asybc_jobs_workflow(
241241
"exposed_rpc_start",
242242
[
243243
rpc_sync_job.__name__,
244-
pytest.param(
245-
rpc_async_job.__name__,
246-
marks=pytest.mark.skip(
247-
reason=(
248-
"hangs after teardown for unknown reason "
249-
"SEE https://github.com/ITISFoundation/osparc-simcore/issues/7486"
250-
)
251-
),
252-
),
244+
rpc_async_job.__name__,
253245
],
254246
)
255247
async def test_async_jobs_cancel(

0 commit comments

Comments
 (0)