Skip to content

Add timeout to requests API calls in OpenFaasHook#62731

Open
Ironankit525 wants to merge 1 commit intoapache:mainfrom
Ironankit525:fix/openfaas-add-timeout
Open

Add timeout to requests API calls in OpenFaasHook#62731
Ironankit525 wants to merge 1 commit intoapache:mainfrom
Ironankit525:fix/openfaas-add-timeout

Conversation

@Ironankit525
Copy link

What happened:
The OpenFaasHook makes several outgoing HTTP requests to the OpenFaaS server using the requests library (requests.post, requests.put, requests.get). None of these requests currently specify a timeout argument.

Without a timeout, an unresponsive OpenFaaS server could cause an Airflow task to hang indefinitely, tying up worker slots.

Fix:
All requests calls in OpenFaasHook now include a configurable timeout parameter (default 60 seconds), read from the connection's extra dictionary. Users can override the timeout via the connection configuration.

All HTTP requests in OpenFaasHook (get, post, put) now include a
configurable timeout parameter (default 60s) read from the connection
extra dict. Without a timeout, an unresponsive server could cause
Airflow tasks to hang indefinitely, tying up worker slots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant