Open lcontami opened 4 years ago
The origin of the issue is the following;
when the job fails, job.cancel() is run, and the perform method returns a False. However, this does not cause the task to fail !
Would the command self.root.should_stop = True stop the task ?
To stop the measurement you can replace return False
by self.root.should_stop.set()
. I would also suggest logging a message explaining the reason.
Actually the cleaner way to proceed would be to have InstrJob
raise an exception on a timeout since this is I believe what is happening here. I may have time tonight to put a PR together if you don't do it first.
On the apply_magnetic_field task, the waiting time for ramping the field is dealt with by an InstrJob (so that the measure can be stopped mid ramp).
Right now the instrument brutally restarts during the ramp. The connection to the instrument is restarted, but the task continue without failing (as if the target value had been reached) or rerunning the ramp.