You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/09/24 22:13:17 UTC
[GitHub] [airflow] hussein-awala opened a new pull request, #34589: Remove false warning when TI state is QUEUED and TI doesn't have a start_date
hussein-awala opened a new pull request, #34589:
URL: https://github.com/apache/airflow/pull/34589
closes: #34493
Airflow changes the TI state to queue in two cases:
- https://github.com/apache/airflow/blob/7a5b6a39c948bc51d754898b0478ad319dfab43f/airflow/jobs/backfill_job_runner.py#L533
- https://github.com/apache/airflow/blob/7a5b6a39c948bc51d754898b0478ad319dfab43f/airflow/jobs/scheduler_job_runner.py#L603-L614
and in both cases, TI may not have a start date if it's the first attempt, so the warning raised by `emit_state_change_metric` method is false, and should be suppressed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove false warning when TI state is QUEUED and TI doesn't have a start_date [airflow]
Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala commented on PR #34589:
URL: https://github.com/apache/airflow/pull/34589#issuecomment-1751781980
I close it in favor of #34771.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #34589: Remove false warning when TI state is QUEUED and TI doesn't have a start_date
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #34589:
URL: https://github.com/apache/airflow/pull/34589#discussion_r1338345342
##########
airflow/models/taskinstance.py:
##########
@@ -2165,12 +2165,8 @@ def emit_state_change_metric(self, new_state: TaskInstanceState) -> None:
elif new_state == TaskInstanceState.QUEUED:
metric_name = "scheduled_duration"
if self.start_date is None:
- # same comment as above
- self.log.warning(
- "cannot record %s for task %s because previous state change time has not been saved",
- metric_name,
- self.task_id,
- )
+ # this could happen when the scheduler queue a TI
+ # or when the backfill CLI send a TI to the executor
Review Comment:
Would it be a good idea for those cases to set the start date instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #34589: Remove false warning when TI state is QUEUED and TI doesn't have a start_date
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #34589:
URL: https://github.com/apache/airflow/pull/34589#discussion_r1338345342
##########
airflow/models/taskinstance.py:
##########
@@ -2165,12 +2165,8 @@ def emit_state_change_metric(self, new_state: TaskInstanceState) -> None:
elif new_state == TaskInstanceState.QUEUED:
metric_name = "scheduled_duration"
if self.start_date is None:
- # same comment as above
- self.log.warning(
- "cannot record %s for task %s because previous state change time has not been saved",
- metric_name,
- self.task_id,
- )
+ # this could happen when the scheduler queue a TI
+ # or when the backfill CLI send a TI to the executor
Review Comment:
Would it be a good idea for those cases to set the start date, or do a proactive filter to not call this function if the start date is None instead?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove false warning when TI state is QUEUED and TI doesn't have a start_date [airflow]
Posted by "hussein-awala (via GitHub)" <gi...@apache.org>.
hussein-awala closed pull request #34589: Remove false warning when TI state is QUEUED and TI doesn't have a start_date
URL: https://github.com/apache/airflow/pull/34589
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org