Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with pysmurf zero_biases wait functionality #616

Open
jlashner opened this issue Jan 11, 2024 · 1 comment
Open

Issue with pysmurf zero_biases wait functionality #616

jlashner opened this issue Jan 11, 2024 · 1 comment
Labels
bug Something isn't working needs triage Cause of bug still unknown, needs investigation.

Comments

@jlashner
Copy link
Collaborator

The beginning of a satp1 schedule failed with the error because the zero_biases is not actually waiting for set_biases to finish.

2024-01-11T22:29:36+0000 start called for uxm_relock
2024-01-11T22:29:36+0000 uxm_relock:97 Status is now "starting".
2024-01-11T22:29:36+0000 uxm_relock:97 Operation failed: set_biases is running.
2024-01-11T22:29:36+0000 uxm_relock:97 Status is now "done".
2024-01-11T22:29:36+0000 set_biases:96 Finished setting biases to 0
2024-01-11T22:29:36+0000 set_biases:96 Status is now "done".

Zero biases is implemented to call the set_biases tasks and wait to finish like this:

@ocs_agent.param('bgs', default=None)
def zero_biases(self, session, params):
"""
**Task** - Zeros TES biases for specified bias groups.
Args
-----
bg: int, list, optional
bg, or list of bgs to zero. If None, will zero all bgs.
"""
params['bias'] = 0
self.agent.start('set_biases', params)
self.agent.wait('set_biases')
return True, 'Finished zeroing biases'

However now I'm not actually sure if the wait function will wait if running in a blocking-thread, since it is a generator w/ inline callbacks, meant to run in the main thread. The simplest fix is that this should probably just be a completely separate task and acquire the lock / zero the TES biases itself instead of passing params to set_biases

@jlashner jlashner changed the title Issue with pysmurf zero_biases Issue with pysmurf zero_biases wait functionality Jan 11, 2024
@mhasself
Copy link
Member

You could blockingCallFromThread those and I guess that would work. You should check for and propagate error though. start and wait can each return errors.

@BrianJKoopman BrianJKoopman added bug Something isn't working needs triage Cause of bug still unknown, needs investigation. labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Cause of bug still unknown, needs investigation.
Projects
None yet
Development

No branches or pull requests

3 participants