soft-timeout to upstream using timers?

Skip to first unread message

Jun 17, 2024, 11:50:36 AMJun 17
to openresty-en

do you have any ideas if  it will be possible to somehow implement timeout mechanism in OpenResty, similar to upstream_timeout but with one difference that it does not drop connection to backend but just return response to client?

What I mean exactly is that I would like to have 2 timeouts to my backends:
 - upstream_timeout (currently present in Nginx)
 - soft_upstream_timeout (significantly smaller than upstream_timeout, new)

When soft_upstream_timeout fires then request processing is stopped and some default response is returned to client BUT connection to upstream is not dropped and can be possibly reused for future requests. Of course if late response come from backend then it must be just ignored, because client already got default response and is not waiting anymore... 

Connection to upstream is dropped only when upstream_timeout fires.

Any ideas or pointers?

Reply all
Reply to author
0 new messages