Skip to content

This allows defining session independent locks with the DEVICE_LOCKS …#552

Open
MarcusZuber wants to merge 10 commits into
masterfrom
multiple_session_locks
Open

This allows defining session independent locks with the DEVICE_LOCKS …#552
MarcusZuber wants to merge 10 commits into
masterfrom
multiple_session_locks

Conversation

@MarcusZuber

@MarcusZuber MarcusZuber commented May 6, 2025

Copy link
Copy Markdown
Member

…(list of strings) variable

In a session file you can add e.g. DEVICE_LOCKS = ['my_camera1', 'reco_1_server'] to prevent the usage of devices that should be accessed only once and adding the same entry in another session file.

This exends the MULTIINSTANCE implementation. I can now specify sets of locks in session files.
The use case is, that we often use the same devices (which are somethimes not happy to be accessed multiple times) from diffrent sessions.
I can now do stuff like this:

# session 1 that uses a specific camera and a remote-online-reco
DEVICE_LOCKS = ['camera1', 'reco_server1']

# session 2 that uses 'camera1' that does not like to be shared
DEVICE_LOCKS=['camera1']

TODO:

  • Add documentation
  • Add tests (also for the MULTIINSTANCE implementation)

@codecov

codecov Bot commented May 6, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.34606% with 229 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.59%. Comparing base (f30a00b) to head (e983ad0).

Files with missing lines Patch % Lines
concert/session/utils.py 30.69% 228 Missing ⚠️
concert/tests/integration/test_session_locks.py 98.70% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #552      +/-   ##
==========================================
- Coverage   83.69%   82.59%   -1.10%     
==========================================
  Files         133      134       +1     
  Lines       10973    11390     +417     
==========================================
+ Hits         9184     9408     +224     
- Misses       1789     1982     +193     

☔ 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.

@MarcusZuber

Copy link
Copy Markdown
Member Author

@tfarago : Do you have an idea how we could test the session-locks elegantly without system calls?

Comment thread bin/concert Outdated
@tfarago

tfarago commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Looks useful.

@tfarago

tfarago commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

@tfarago : Do you have an idea how we could test the session-locks elegantly without system calls?

Write a mockup StartCommand or make a mockup of IPython.

@MarcusZuber MarcusZuber force-pushed the multiple_session_locks branch from 9cd481f to 5b46fd6 Compare May 6, 2026 06:50
@MarcusZuber MarcusZuber force-pushed the multiple_session_locks branch from 323cb08 to e983ad0 Compare May 6, 2026 11:26
@MarcusZuber

MarcusZuber commented May 6, 2026

Copy link
Copy Markdown
Member Author

Some explanation about e983ad0 :

concert._aimoirt.register() could only be called once before this commit (the paths were stored in a global variable that is not reset between tests and it does nothing if there are aready patht sepcified). The testing of the session-start triggered this the first time in the pytest run and then the register() in the aimport-test did nothing.

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