Skip to content

Conversation

@tpoliaw
Copy link
Contributor

@tpoliaw tpoliaw commented Nov 11, 2025

This is awful in so many ways but having to kill the process via SIGKILL every time it runs is a pain, especially for things like pytest which would otherwise complete without any interaction.

Due to an assumed bug in libca, processes that import ophyd but do not
create any signals do not exit cleanly. As the main process in blueapi
never creates any signals (they are all created and managed by the task
worker threads), the process always hangs at exit.

Creating a non-functional signal if ophyd has been imported means the
process can exit cleanly again.

This also solves the problem where the environment cannot be reset if no
devices are defined (for the same reason).
@tpoliaw tpoliaw requested a review from a team as a code owner November 11, 2025 18:06
@tpoliaw tpoliaw requested a review from coretl November 11, 2025 18:07
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.76%. Comparing base (fd309ae) to head (9623574).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1277   +/-   ##
=======================================
  Coverage   94.75%   94.76%           
=======================================
  Files          41       41           
  Lines        2670     2674    +4     
=======================================
+ Hits         2530     2534    +4     
  Misses        140      140           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tpoliaw tpoliaw changed the title Add fake signal to prevent blueapi hanging on shutdown fix: Add fake signal to prevent blueapi hanging on shutdown Nov 12, 2025
@DiamondJoseph DiamondJoseph merged commit ab3be3d into main Nov 12, 2025
19 of 20 checks passed
@DiamondJoseph DiamondJoseph deleted the hanging-workaround branch November 12, 2025 14:09
@tpoliaw tpoliaw linked an issue Nov 12, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blueapi hangs on shut down

3 participants