pankajastro commented on code in PR #40019:
URL: https://github.com/apache/airflow/pull/40019#discussion_r1624216146
##########
airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -219,15 +219,17 @@ def _format_exception_description(self, exc: Exception)
-> Any:
async def _wait_for_pod_start(self) -> ContainerState:
"""Loops until pod phase leaves ``PENDING`` If timeout is reached,
throws error."""
- delta = datetime.datetime.now(tz=datetime.timezone.utc) -
self.trigger_start_time
- while self.startup_timeout >= delta.total_seconds():
+ while True:
pod = await self.hook.get_pod(self.pod_name, self.pod_namespace)
if not pod.status.phase == "Pending":
return self.define_container_state(pod)
+
+ delta = datetime.datetime.now(tz=datetime.timezone.utc) -
self.trigger_start_time
+ if self.startup_timeout < delta.total_seconds():
+ raise PodLaunchTimeoutException("Pod did not leave 'Pending'
phase within specified timeout")
Review Comment:
Aha, Nice!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]