Wrap setup_amps in try during relock for two attempts#508
Conversation
tristpinsm
left a comment
There was a problem hiding this comment.
Not loving the nested try/except here but ok :)
|
Yeah I also don't love the nested trys. Maybe include it in a for-loop, like Also, could this logic be moved within |
tristpinsm
left a comment
There was a problem hiding this comment.
Actually, sorry I approved too soon. One more request: Could we log the exception when it is caught? Otherwise it gets really hard to figure out what is going on.
Change to while loop and handle Exception explicitly Co-authored-by: Tristan Pinsonneault-Marotte <tristpinsm@gmail.com>
There was a problem hiding this comment.
Can this logic be moved to be within uxm_setup.setup_amps instead?
Here:
sodetlib/sodetlib/operations/uxm_setup.py
Lines 217 to 222 in 279def4
That's the cause of the failure and where it should be caught and dealt with, not in this function. uxm_setup.uxm_setup also has a call to setup_amps, and repeating this check there would duplicate code.
Semi-frequently after a hammer
setup_ampsfails onuxm_relock, usually due to a key error for the name of one of the amplifiers. It's pretty much always fixed by runninguxm_relockagain, but ROCs don't know to do this and smurf-tsars can be slow to respond.This is a very simple solution of wrapping
setup_ampsin atry. If it fails, it tries again. If the second attempt fails, then it errors out.