Skip to content

Commit

Permalink
Merge pull request #3484 from broadinstitute/first-dag-trigger-bug
Browse files Browse the repository at this point in the history
handle error for first loading time dag is triggered
  • Loading branch information
hanars authored Jul 13, 2023
2 parents a9fcbed + 8dc412c commit 4d69712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions seqr/views/apis/data_manager_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ def test_load_data(self, mock_subprocess):
url = reverse(load_data)
self.check_pm_login(url)

responses.replace(responses.GET, f'{self.dag_url}/dagRuns', json={'dag_runs': []})
mock_subprocess.return_value.communicate.return_value = b'', b'File not found'
body = {'filePath': 'gs://test_bucket/mito_callset.mt', 'datasetType': 'MITO', 'sampleType': 'WGS', 'projects': [
'R0001_1kg', 'R0004_non_analyst_project',
Expand Down
4 changes: 2 additions & 2 deletions seqr/views/utils/airflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def _send_slack_msg_on_failure_trigger(e, dag_id, dag, error_message):
def _check_dag_running_state(dag_id):
endpoint = 'dags/{}/dagRuns'.format(dag_id)
resp = _make_airflow_api_request(endpoint, method='GET')
lastest_dag_runs = resp['dag_runs'][-1]
if lastest_dag_runs['state'] == 'running':
dag_runs = resp['dag_runs']
if dag_runs and dag_runs[-1]['state'] == 'running':
raise DagRunningException(f'{dag_id} is running and cannot be triggered again.')


Expand Down

0 comments on commit 4d69712

Please sign in to comment.