Hi @Panayiotis Zinieris ,
Thank you for your detailed explanation of the issue. It appears that you're encountering issues with the Azure Load Balancer not consistently sending TCP Reset (RST) packets to both the client and server after idle connections. The behavior you've described, where RST packets are only sent during certain events (such as server restarts or new deployments), may be linked to the idle timeout settings and how the Load Balancer handles idle connections.
As per Azure documentation, the default behavior of the Load Balancer is to silently drop connections when the idle timeout is reached. However, if TCP Reset is enabled, it should ideally send RST packets in both directions to inform the client and server that the connection is no longer valid. If this behavior is not occurring consistently, it could be attributed to several factors, including:
- Make sure the idle timeout settings for your Load Balancer are set correctly. The default timeout is 4 minutes, but you can change it to as long as 100 minutes for certain rules. When the timeout happens, the Load Balancer should send RST packets if it's set up to do so.
- Network problems like lost packets or delays can affect how RST packets are delivered. Using tools like Wireshark to check network traffic can help you see if packets are being sent but not received. Also, if your application doesn’t handle RST packets well or has issues with managing connections, it might not react properly when connections are dropped.
- Even though you said keep-alives are turned off, turning on TCP keep-alives can help keep the connection alive and make it easier to spot broken connections.
If you have explored all the options in the Azure Load Balancer settings and your application configuration, you might want to consider implementing application-level keep-alives or monitoring mechanisms to more effectively detect broken connections.
For your reference, please review the following documentation for further clarification:
I hope this is helpful! Feel free to reach out if you have any more questions or need further assistance.