-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Request Failure Handling #820
Comments
Hi @aslanpour We are going to need exact steps to be able to help you and a sample function. If you don't provide this then unfortunately, we'll have to close your support request. Regards, Alex |
/add labels: support,question |
@aslanpour please see my comment. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all, I am sending async requests to a function and a call-back is set to receive the responses on a client. I also set some headers for requests, so I can attribute the function's response to the corresponding sender.
Also, while serving requests, there is a chance that my function is down temporarily, say due to rescheduling the Pods. In that case, I am receiving a 50X status code on my client and the headers I set are missed. Is there any way I can identify a request when returning a 50X status code?
I also see OpenFaaS sets some headers on the request such as X-Start-Time, X-Duration-Seconds, etc. In the case of returning status code 500, sometimes the X-Start-Time header is also missed in the response. For me, this 500 happens when the function is rescheduled or deleted while the request is being executed.
Thanks,
Mohammad
Expected Behaviour
Headers set users (senders) and sometimes headers set by OpenFaaS on requests should not be missed.
Not a solution I have as I need more understanding of OpenFaaS components.
Current Behaviour
Headers are missed when a function responsible for executing a request is failed or being rescheduled.
No suggestion
Are you a GitHub Sponsor (Yes/No?)
Check at: https://github.com/sponsors/openfaas
List All Possible Solutions and Workarounds
I think queue-worker or gateway need to take care of headers if they are not.
A failure handling for function invocation would help.
I have no idea.
Which Solution Do You Recommend?
I would assign a reliable component such as queue-worker or gateway to handle the failures.
Steps to Reproduce (for bugs)
No link
A sample Python code I use in a Flask server for sending requests.
url = 'http:https://'+gateway_IP + ':31112/async-function/myfunction'
header = {'X-Callback-Url':'http:https://' + client_IP + ':5000/actuator',
'Sensor-ID': sensor_id}
response=requests.post(url, headers=header)
And on the client, I verify the header by this:
print(str(request.headers))
Context
I am trying to verify which sender's request is failed.
Provided
Your Environment
faas-cli version
):0.13.13
docker version
(e.g. Docker 17.0.05 ):...
kubectl version
k3s version 21
Raspbian
none
none
The text was updated successfully, but these errors were encountered: