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.39%. Comparing base (77bc0d4) to head (53c804b).

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.45%   82.39%   -1.07%     
==========================================
  Files         136      137       +1     
  Lines       11279    11696     +417     
==========================================
+ Hits         9413     9637     +224     
- Misses       1866     2059     +193     

☔ View full report in Codecov by Harness.
📢 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 2 times, most recently 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.

@MarcusZuber
MarcusZuber force-pushed the multiple_session_locks branch from e983ad0 to 53c804b Compare August 6, 2026 07:11
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