BlueAPI client hangs after task completes on server (pl.rd, pl.move)
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Start in BlueAPISession._live_plot_during_task in sm_bluesky/common/clients/blueapi_session.py around line 178, where the wrapper polls with time.sleep and then blocks on future.result(). Compare with the server-side event handling in blueapi.worker.task_worker, since the log shows the task finishing before the client waits. Done means pl.rd and pl.move return the result after a task finishes early or a Stomp reconnect occurs, with tests for both cases.
由索引模型根据 Issue 内容生成。
描述
Plans complete successfully on the BlueAPI server, but the client never receives the result and blocks until Ctrl-C. Both cases hang in BlueAPISession._live_plot_during_task (blueapi_session.py:178) waiting on future.result().
pl.rd(dev.halbach.angle): server log showsTask ran successfully - returned: -180.0within ~1 ms, client never returns.pl.move({dev.energy_ud: 630}): move completes on the server, client logsStomp connection lost, will attempt reconnection ...and never returns.pl.set_absolute(dev.energy_ud, 638)returns fine.
Likely cause: the task-complete event is missed (fast tasks finishing before the listener is ready, or events lost during the Stomp reconnect), so the future is never resolved.
Environment: i10, i10_sm-bluesky venv, Python 3.12
Steps To Reproduce
- Start an I10 BlueAPI client session.
- Run
pl.rd(dev.halbach.angle); it hangs. - Run
pl.move({dev.energy_ud: 630}); it hangs afterStomp connection lost. - Compare the server log, which shows both tasks finished.
Acceptance Criteria
pl.rdandpl.movereturn their result on the client once the server task finishes.- A Stomp disconnect/reconnect during a task doesn't leave the client waiting forever (fall back to polling task status over REST, or add a timeout with a clear error).
- Tests cover a task that finishes before the client starts listening, and a dropped connection mid-task.
Client Log
pl.rd(dev.halbach.angle)
WARNING:blueapi.config:OIDCConfig.well_known_url is deprecated, Please use OIDCConfig.issuer
WARNING:blueapi.config:OIDCConfig.well_known_url is deprecated, Please use OIDCConfig.issuer
WARNING:blueapi.config:OIDCConfig.well_known_url is deprecated, Please use OIDCConfig.issuer
WARNING:blueapi.config:OIDCConfig.well_known_url is deprecated, Please use OIDCConfig.issuer
^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[15], line 1
----> 1 pl.rd(dev.halbach.angle)
File /dls_sw/i10/software/blueapi/i10_sm-bluesky/lib64/python3.12/site-packages/blueapi/client/plan_cache.py:85, in Plan.call(self, *args, **kwargs)
78 req = TaskRequest(
79 name=self.name,
80 args=list(args),
81 params=kwargs,
82 instrument_session=self._client.instrument_session,
83 )
84 try:
---> 85 match self._client.run_task(req):
86 case TaskStatus(result=TaskResult(result=res)):
87 return res
File /dls_sw/i10/software/blueapi/i10_sm-bluesky/lib64/python3.12/site-packages/sm_bluesky/common/clients/blueapi_session.py:178, in BlueAPISession._live_plot_during_task..wrapper(*args, **kwargs)
176 last_update = now
177 self._refresh_plots(update_data=should_update)
--> 178 time.sleep(0.18)
179 self._refresh_plots(update_data=True)
180 return future.result()
KeyboardInterrupt:
Server log
2026-11-21T12:40:06.524137978Z 2026-11-21 12:40:06,523 INFO blueapi.worker.task Asked to run plan rd with {} and metadata {'user': 'wvx67826', 'instrument_session': 'cm44153-5', 'blueapi_task_id': '3fb209c7-b01c-43d1-855b-27cb749e6ca8'} for all runs
2026-11-21T12:40:06.524219810Z 2026-11-21 12:40:06,524 INFO bluesky Executing plan <generator object rd at 0x7f5da919c280>
2026-11-21T12:40:06.524384930Z 2026-11-21 12:40:06,524 INFO bluesky.RE.state Change state on <bluesky.run_engine.RunEngine object at 0x7f5d52a392b0> from 'idle' -> 'running'
2026-11-21T12:40:06.525071020Z 2026-11-21 12:40:06,525 INFO blueapi.service.main 10.42.0.34:58298 PUT /worker/task 200
2026-11-21T12:40:06.525084302Z 2026-11-21 12:40:06,525 INFO bluesky.RE.state Change state on <bluesky.run_engine.RunEngine object at 0x7f5d52a392b0> from 'running' -> 'idle'
2026-11-21T12:40:06.525357629Z 2026-11-21 12:40:06,525 INFO bluesky Cleaned up from plan <generator object rd at 0x7f5da919c280>
2026-11-21T12:40:06.525496440Z 2026-11-21 12:40:06,525 INFO blueapi.worker.task_worker Task ran successfully - returned: -180.0
2026-11-21T12:40:06.525866676Z 2026-11-21 12:40:06,525 INFO blueapi.worker.task_worker Awaiting task
- 主要语言
- Python
- 星标
- 14
- 派生
- 15
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 35
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DiamondLightSource/blueapi 的其他 Issue
-
bug support: low
难度 2/5 1-3 小时 新手友好度 70/100
DiamondLightSource/blueapi#1802 · 1 条评论 ·
维护者通常 2 天内回复
-
support: low
难度 2/5 1-3 小时 新手友好度 68/100
DiamondLightSource/blueapi#1772 · 2 条评论 ·
维护者通常 2 天内回复
-
deployment dev-environment
难度 2/5 1-3 小时 新手友好度 75/100
DiamondLightSource/blueapi#1623 · 2 条评论 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
DiamondLightSource/blueapi#1605 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
DiamondLightSource/blueapi#1494 ·
维护者通常 2 天内回复
查看 DiamondLightSource/blueapi 的全部 Issue
相似的 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
ClickHouse/clickhouse-connect#1266 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
biosustain/growthcurves_app#89 ·
维护者通常 1 天内回复
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not exist未关闭
难度 2/5 1-3 小时 新手友好度 78/100
canonical/loki-k8s-operator#695 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复