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

   ### Apache Airflow version
   
   2.8.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I have a PythonOperator in my dag , in the python_callable function calls a 
http url by using `httpx.get(url)` . when i trigger the dag , the task instance 
keeps running , and the log stops before httpx.get . and it doesn't raise 
timeout error .
   
   i tried  httpx and requests, and got the same problem.
   
   <img width="1080" alt="image" 
src="https://github.com/apache/airflow/assets/7379670/7ff53133-f948-40ad-b853-21b687c997c8";>
   
   this is my code:
   ```python
           url='https://pokeapi.co/api/v2/pokemon/151'
   
           ## 1. try with httpx
           # print('begin with httpx.Client')
           # client = httpx.Client(timeout=30)  # stuck here
           # print('client = ', client)
           # resp = client.get(url=url)
           # print('resp = ', resp, resp.is_success)
   
           ## 2. try with httpx.AsyncClient
           # print('begin with httpx.AsyncClient')
           # client = httpx.AsyncClient(timeout=30)  # stuck here
           # print('client = ', client)
           # resp = client.get(url=url)
           # resp = asyncio.run(resp)
           # print('resp = ', resp)
   
           ## 3. try with requests
           print('begig with requests')
           session = requests.session()
           print('session = ', session)
           resp = session.get(url=url, timeout=30)  # stuck here
           print('resp = ', resp, resp)
   
   ```
   
   and log like this:
   
   <img width="951" alt="image" 
src="https://github.com/apache/airflow/assets/7379670/a22840ff-88dd-4133-857c-077d250a33db";>
   
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   the code i provided
   
   ### Operating System
   
   macOS 13.4.1
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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