-
Notifications
You must be signed in to change notification settings - Fork 131
Description
Informations
- Qiskit Experiments version: v0.1-0.2
- Python version:
- Operating system:
What is the current behavior?
Currently post experiment processing (e.g. analysis) is attached as callback to the experiment data. The composite experiment adds another callback to wait for child experiment to finish form _run_analysis callback. However, since the thread for ExperimentData.block_for_result and ExperimentData.add_analysis_callback are async, a callback queued from another callback sometimes not caught by the blocking mechanism.
batch_exp = BatchExperiment([exp1, exp2], backend=my_backend)
exp_data = batch_exp.run()
exp_data.block_for_result()
exp_data.status()As a consequence, above example code sometimes returns "POST_PROCESSING" while blocking is set before the status check. This doesn't become serial problem for the most of use cases because the most time consuming part of experiment is circuit execution. Once jobs are returned, analysis callbacks will complete immediately, and you'll get the status "DONE" as expected.
One of temporarily fix would be #570 , however this is not limited to the composite experiment (you have chance to run into the bug with whatever experiment with multiple callbacks). So this is not proper approach. We need more safer lock mechanism.
There is another bug that such thread safe object doesn't work properly.
The callback added to the experiment data is executed in this wrapper. When some error happens during execution, this will be suppressed and the thread returns the status with error flag with the warning level log with actual error message. However, with some reason, the experiment data status method returns "DONE" instead of "ERROR". This is reported in #533 .