Question regarding stale sockets and EWOULDBLOCK

Felipe Polanco felipeapolanco at gmail.com
Tue Nov 7 21:16:38 UTC 2023


Hello,

We have a situation with NGINX forward proxy and I would like the
community's input on how to handle this.

We run long-lived TCP sockets in our business, and we authorize transaction
requests on behalf of our customers.

We use NGINX as the TLS termination proxy.

We are experiencing issues when our customer's internal network goes down
but the link stays up, we send transactions to them but nothing comes back
(no TCP ACK). We see TCP retransmissions at this point.

At this point the NGINX send buffer starts filling up, until it reaches the
buffer maximum size but the socket is not dropped, we monitor it using
netstat output.

NGINX just does nothing nor logs any error when this happens, this scenario
is called EWOULDBLOCK socket error, we handle this in our application but
when we introduced NGINX we are now timing out transactions.

We cannot use proxy_timeout because these are long-lived sockets, some stay
up for months waiting for authorization requests.

Is there any option in NGINX that we can use to close the maxed out socket?

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20231107/0bfc325e/attachment.htm>


More information about the nginx mailing list