BlueAPI client hangs after task completes on server (pl.rd, pl.move)
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- backend, distributed-systems
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 14
- Forks
- 15
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 35
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus DiamondLightSource/blueapi
-
bug support: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
DiamondLightSource/blueapi#1802 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
support: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
DiamondLightSource/blueapi#1772 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
deployment dev-environment
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
DiamondLightSource/blueapi#1623 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Cannot Install SoftiocOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
DiamondLightSource/blueapi#1605 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
DiamondLightSource/blueapi#1494 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in DiamondLightSource/blueapi
Ähnliche Issues
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 79/100
developmentseed/titiler-covjson#164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
awslabs/visual-asset-management-system#2164 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainer antworten meist innerhalb von 1 Tag
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag