Skip to content

Comments

WIP feat: lock devices during a scan#733

Open
d-perl wants to merge 6 commits intomainfrom
feat/device_locking
Open

WIP feat: lock devices during a scan#733
d-perl wants to merge 6 commits intomainfrom
feat/device_locking

Conversation

@d-perl
Copy link
Contributor

@d-perl d-perl commented Jan 15, 2026

Add a lock manager to the scan server to manages sharing of devices

Initial implementation only blocks while waiting for locks but lock manager has the required functionality to check and raise instead

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 52.32558% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_server/bec_server/scan_server/scan_worker.py 31.42% 20 Missing and 4 partials ⚠️
...ec_server/bec_server/scan_server/device_locking.py 63.15% 11 Missing and 3 partials ⚠️
bec_server/bec_server/scan_server/scans.py 72.72% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@d-perl d-perl force-pushed the feat/device_locking branch 2 times, most recently from b7a9ca3 to 3fe21c6 Compare January 15, 2026 16:42
@d-perl d-perl force-pushed the feat/device_locking branch from 3fe21c6 to d68f406 Compare January 29, 2026 09:13
@d-perl d-perl force-pushed the feat/device_locking branch from 05dbda1 to 2ab5bec Compare February 3, 2026 08:27
@d-perl d-perl force-pushed the feat/device_locking branch from 2ab5bec to 3a58dbe Compare February 3, 2026 11:10
devices_to_lock = []
else:
devices_to_lock = scan_instance.instance_device_access().device_locking
with self.parent.device_locks.lock(devices_to_lock):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the change here merely an indentation due to the context manager? GH diff is a bit confusing...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's just indented one level deeper

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.

2 participants