Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
96a72e3
fix(worker): correctly handle pause, resume and cancel via worker thr…
Alexj9837 Jun 30, 2026
c21efe0
fix(worker): fix pause/resume/cancel bugs found in review
Alexj9837 Jul 8, 2026
7adfe36
adding more tests to cover when a resume plan is paused immediaetly.
Alexj9837 Jul 13, 2026
9988e2d
code review suggestions
Alexj9837 Jul 14, 2026
8549ca6
cancel_active_task() set the outcome after RE.abort()/stop() returned,
Alexj9837 Jul 14, 2026
c4f1671
reducing comments
Alexj9837 Jul 14, 2026
c7b8d26
Merge branch 'main' into plan-pause
Alexj9837 Aug 12, 2026
5e78865
Refactor test_put_worker_task to accept long_task
Alexj9837 Aug 12, 2026
3d2eb4f
extracting suggestion from #1622 , going for a blocking run egine des…
Alexj9837 Aug 19, 2026
6375d4c
fix: cancel_active_task() waited on RunEngine state instead of the ac…
Alexj9837 Aug 19, 2026
ce4ea4c
fix: cancel_active_task()'s immediate path returned before the worker…
Alexj9837 Aug 19, 2026
d6f4029
normalising messages.
Alexj9837 Aug 21, 2026
f509efb
merging abortSignal and CancelSignal as I stole abortSignal from Peter
Alexj9837 Aug 21, 2026
dd71524
fix: resume() polled shared RunEngine state via Condition.wait_for(),…
Alexj9837 Aug 21, 2026
97cbc19
made the logic when waiting for cancel to complete into a help func.
Alexj9837 Aug 21, 2026
f17a28f
both abort failure paths mirror report the correct response
Alexj9837 Aug 21, 2026
c6a9ed1
Merge remote-tracking branch 'origin/main' into plan-pause
Alexj9837 Aug 21, 2026
39b7885
adding an ignore to make codecov happy
Alexj9837 Aug 21, 2026
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
5 changes: 3 additions & 2 deletions docs/reference/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ components:
title: Errors
type: array
is_complete:
default: false
readOnly: true
title: Is Complete
type: boolean
is_pending:
Expand All @@ -389,6 +389,7 @@ components:
required:
- task_id
- task
- is_complete
title: TrackableTask
type: object
ValidationError:
Expand Down Expand Up @@ -449,7 +450,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
title: BlueAPI Control
version: 1.5.0
version: 1.5.1
openapi: 3.1.0
paths:
/api/v1/devices:
Expand Down
2 changes: 1 addition & 1 deletion src/blueapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class ApplicationConfig(BlueapiBaseModel):
"""

#: API version to publish in OpenAPI schema
REST_API_VERSION: ClassVar[str] = "1.5.0"
REST_API_VERSION: ClassVar[str] = "1.5.1"

LICENSE_INFO: ClassVar[dict[str, str]] = {
"name": "Apache 2.0",
Expand Down
12 changes: 8 additions & 4 deletions src/blueapi/worker/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from collections.abc import Mapping
from typing import Any

from bluesky.run_engine import RunEngineResult
from pydantic import BaseModel, Field, TypeAdapter

from blueapi.core import BlueskyContext
Expand Down Expand Up @@ -29,7 +30,7 @@ def prepare_params(self, ctx: BlueskyContext) -> Mapping[str, Any]:
# Re-create dict manually to avoid nesting in model_dump output
return {field: getattr(model, field) for field in model.__pydantic_fields__}

def do_task(self, ctx: BlueskyContext) -> None:
def do_task(self, ctx: BlueskyContext) -> Any:
LOGGER.info(
f"Asked to run plan {self.name} with {self.params} and "
f"metadata {self.metadata} for all runs"
Expand All @@ -39,9 +40,12 @@ def do_task(self, ctx: BlueskyContext) -> None:
prepared_params = self.prepare_params(ctx)
ctx.run_engine.md.update(self.metadata)
result = ctx.run_engine(func(**prepared_params))
if isinstance(result, tuple): # pragma: no cover
# this is never true if the run_engine is configured correctly
return None
if not isinstance(result, RunEngineResult): # pragma: no cover
# this is unreachable unless something has misconfigured it.
raise RuntimeError(
"RunEngine did not return a RunEngineResult - is "
"call_returns_result set on this RunEngine instance?"
)
return result.plan_result


Expand Down
Loading