TCP Connections dropped after approx 5 mins of inactivity

Mike Taylor 116 Reputation points
2020-11-05T10:30:16.17+00:00

I have the idle timeout set to 20 minutes. However, tests with a Python TCP client talking to a a Python TCP server using "epoll", give me an issue when the idle time is roughly 5 minutes of inactivity. I loose the last packet sent, and get an error thrown from the client when after 10 minutes it tries to close the connection, as follows:-

Traceback (most recent call last):
File "atlas_client.py", line 121, in <module>
make_connection()
File "atlas_client.py", line 111, in make_connection
skt.shutdown(socket.SHUT_RDWR)
OSError: [Errno 107] Transport endpoint is not connected

Running this test locally on my Ubuntu VM, gives no such issue.

I am a bit of a loss as to what to try. I can (I believe) force keep-alive packets, however on a 4g connection when we are paying for each and every byte sent/received I don't really want to do this.

How can I tell whether this is an Azure firewall issue, Ubuntu VM or a problem with my code?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,873 questions
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
662 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,427 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mike Taylor 116 Reputation points
    2020-11-16T19:17:57.58+00:00

    That's ok thank you, I have asked the question via Azure portal.


9 additional answers

Sort by: Most helpful
  1. Mike Taylor 116 Reputation points
    2020-11-12T12:25:55.29+00:00

    @SaiKishor-MSFT

    Both side were done simultaneously, but to be sure I have redone them again and uploaded to the same place as before.

    Here is a guide to to the timeline:-
    11:56:00 Server was started
    11:57:00 Client was started (Pkt No 1 in client trace)
    11:57:17 Client sends first packet (Pkt No 4 in client trace, Pkt No 6 in server trace)
    12:02:17 Client (attempts) sends second packet (Pkt No 8 in client trace, Nothing in server trace)
    12:02:36 Client gives up and closes the connection (Pkt No 10 in client trace, Nothing in server trace)
    12:06:20 Server was stopped (Pkt No 10 in server trace).

    The reason you don't see the server send a RST is the connection has already been broken?

    Sub Id is 48dfe72b-8506-4366-9425-869bd1f64cef


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.