chuxiangfeng opened a new issue, #29303:
URL: https://github.com/apache/airflow/issues/29303

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   airflow version:2.4.1
   python:3.7.13
   After the KubernetesPodOperator task is created,The await_pod_start method 
will check every second to see if the Pod has started successfully. 
   `    def await_pod_start(self, pod: V1Pod, startup_timeout: int = 120) -> 
None:
           curr_time = datetime.now()
           while True:
               remote_pod = self.read_pod(pod)
               if remote_pod.status.phase != PodPhase.PENDING:
                   break
               self.log.warning("Pod not yet started: %s", pod.metadata.name)
               delta = datetime.now() - curr_time
               if delta.total_seconds() >= startup_timeout:
                   msg = (
                       f"Pod took longer than {startup_timeout} seconds to 
start. "
                       "Check the pod events in kubernetes to determine why."
                   )
                   raise PodLaunchFailedException(msg)
               time.sleep(1)`
   However, my Pod will end immediately without running under some conditions. 
This will cause await_pod_start to fail to detect that the Pod status is 
Completed. It's stuck in Pod not yet started, it's always blocked, and the 
mission status is always Running, even after many days
   ```
   [2023-02-02, 08:00:02 CST] {kubernetes_pod.py:381} INFO - `try_number` of 
task_instance: 1
   [2023-02-02, 08:00:02 CST] {kubernetes_pod.py:382} INFO - `try_number` of 
pod: 1
   [2023-02-02, 08:00:02 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:03 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:04 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:06 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:07 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:08 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:09 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:10 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:11 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:12 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:13 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   [2023-02-02, 08:00:14 CST] {pod_manager.py:180} WARNING - Pod not yet 
started: t-crawler-gem-ipo-request-b2eb9a08d4474705afd43bff54323785
   ```
   after above logs,no more log print,task still in Running.
   
   ### What you think should happen instead
   
   after Pod task completed, dag task status set to success.
   
   ### How to reproduce
   
   The Pod mission does nothing and ends immediately
   
   ### Operating System
   
   PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" 
VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian 
HOME_URL="https://www.debian.org/"; SUPPORT_URL="https://www.debian.org/support"; 
BUG_REPORT_URL="https://bugs.debian.org/";
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow==2.4.2
   apache-airflow-providers-cncf-kubernetes==4.4.0
   apache-airflow-providers-common-sql==1.2.0
   apache-airflow-providers-dingding==3.1.0
   apache-airflow-providers-elasticsearch==3.0.3
   apache-airflow-providers-ftp==2.1.2
   apache-airflow-providers-http==2.1.2
   apache-airflow-providers-imap==2.2.3
   apache-airflow-providers-mongo==2.3.3
   apache-airflow-providers-mysql==2.2.3
   apache-airflow-providers-postgres==4.1.0
   apache-airflow-providers-redis==2.0.4
   apache-airflow-providers-sqlite==3.2.1
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to