Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions qiskit_experiments/framework/composite/composite_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

from typing import List, Dict
from time import sleep
import numpy as np
from qiskit.result import marginal_counts
from qiskit_experiments.framework import BaseAnalysis, ExperimentData, AnalysisResultData
Expand Down Expand Up @@ -104,6 +105,12 @@ def _wait_for_components(experiment_data, component_ids):

experiment_data.add_analysis_callback(_wait_for_components, component_ids=component_ids)

# TODO implement proper locking mechanism.
# Because blocking mechanism is sometime terminated before above callback is added to
# the experiment_data callback queue list, we need to extend execution time of this routine
# to ensure this will complete after the callback is actually queued.
sleep(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this problem is specific to composite experiment. Returning before the callback has updated the status could happen to any experiment and probably needs some tweaks in DbExperimentData.status. Adding a 1 second sleep here seems not a good solution.


return analysis_results, []

def _initialize_components(self, experiment, experiment_data):
Expand Down