I have a gunicorn-python-flask (lets say it app1) application that has a timeout of 10 sec on gunicorn workers. For reqeusts running for more than 10sec the worker gets killed and nginx sends Bad Gateway. But the client application (lets say it app2) keeps on waiting for the response from app1 and app2 gets only timeded out after 60 sec (app2's nginx timeout). Is there any way that the app1 sends some meaningful reply to app2 so that app2 doesn't have to wait to 60 sec and knows that app1 has already timed-out ?
Hope I have made the scenario clear. Please ask me for more info if needed. Thanks!
I was expecting that the app2 would somehow know about the app1's Bad Gateway but it seems to keep waiting.
I think there is 2 solutions to this: