[ https://issues.apache.org/jira/browse/AIRFLOW-2860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578596#comment-16578596 ]
ASF GitHub Bot commented on AIRFLOW-2860: ----------------------------------------- feng-tao closed pull request #3745: [AIRFLOW-2860] DruidHook: time check is wrong URL: https://github.com/apache/incubator-airflow/pull/3745 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/airflow/hooks/druid_hook.py b/airflow/hooks/druid_hook.py index 380a3b3314..cafba9c6c1 100644 --- a/airflow/hooks/druid_hook.py +++ b/airflow/hooks/druid_hook.py @@ -85,8 +85,6 @@ def submit_indexing_job(self, json_index_spec): self.log.info("Job still running for %s seconds...", sec) - sec = sec + 1 - if self.max_ingestion_time and sec > self.max_ingestion_time: # ensure that the job gets killed if the max ingestion time is exceeded requests.post("{0}/{1}/shutdown".format(url, druid_task_id)) @@ -95,6 +93,8 @@ def submit_indexing_job(self, json_index_spec): time.sleep(self.timeout) + sec = sec + self.timeout + status = req_status.json()['status']['status'] if status == 'RUNNING': running = True ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > DruidHook: time variable is not updated correctly when checking for timeout > ---------------------------------------------------------------------------- > > Key: AIRFLOW-2860 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2860 > Project: Apache Airflow > Issue Type: Bug > Components: hooks > Reporter: Adam Welsh > Assignee: Adam Welsh > Priority: Trivial > Fix For: 2.0.0 > > > The variable that is used in the condition to check if the Druid ingestion > task has exceeded the max_ingestion_time is not updated correctly. It gets > incremented by one (which is the default value for timeout) but should be > incremented by timeout. -- This message was sent by Atlassian JIRA (v7.6.3#76005)