Can you see the possible cause of the problem from the wireshark tcp package of the rigid application?

there is an online Python application that occasionally deadlocks, that is, the process is present, but the call to the Api interface prompts

.
curl: (56) Recv failure: Connection reset by peer

grab the tcp package locally via wireshark

"TCP","78","0.000000","51325  8000 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=736973079 TSecr=0 SACK_PERM=1"
"TCP","74","0.039896","8000  51325 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1452 SACK_PERM=1 TSval=1018915739 TSecr=736973079 WS=128"
"TCP","66","0.040025","51325  8000 [ACK] Seq=1 Ack=1 Win=132480 Len=0 TSval=736973119 TSecr=1018915739"
"HTTP","280","0.040185","POST /CRFTag/textEmotionTag HTTP/1.1  (application/json)"
"TCP","280","0.221089","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736973299 TSecr=1018915739"
"TCP","280","0.362219","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736973440 TSecr=1018915739"
"TCP","280","0.804312","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736973881 TSecr=1018915739"
"TCP","280","1.486962","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736974561 TSecr=1018915739"
"TCP","74","1.624576","[TCP Spurious Retransmission] 8000  51325 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1452 SACK_PERM=1 TSval=1018917328 TSecr=736974561 WS=128"
"TCP","66","1.624652","[TCP Dup ACK 3-sharp1] 51325  8000 [ACK] Seq=215 Ack=1 Win=132480 Len=0 TSval=736974698 TSecr=1018915739"
"TCP","280","2.651312","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736975721 TSecr=1018915739"
"TCP","74","3.844019","[TCP Spurious Retransmission] 8000  51325 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1452 SACK_PERM=1 TSval=1018919528 TSecr=736975721 WS=128"
"TCP","66","3.844093","[TCP Dup ACK 3-sharp2] 51325  8000 [ACK] Seq=215 Ack=1 Win=132480 Len=0 TSval=736976909 TSecr=1018915739"
"TCP","280","4.779702","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736977841 TSecr=1018915739"
"TCP","280","7.872911","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736980924 TSecr=1018915739"
"TCP","280","13.848645","[TCP Retransmission] 51325  8000 [PSH, ACK] Seq=1 Ack=1 Win=132480 Len=214 TSval=736986884 TSecr=1018915739"
"TCP","60","13.886028","8000  51325 [RST] Seq=1 Win=0 Len=0"

the wireshark log returns to normal after restarting the application

"TCP","78","0.000000","50048  8000 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=32 TSval=837789964 TSecr=0 SACK_PERM=1"
"TCP","74","0.037032","8000  50048 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1460 SACK_PERM=1 TSval=1397333536 TSecr=837789964 WS=128"
"TCP","66","0.037111","50048  8000 [ACK] Seq=1 Ack=1 Win=131744 Len=0 TSval=837790001 TSecr=1397333536"
"HTTP","280","0.037243","POST /CRFTag/textEmotionTag HTTP/1.1  (application/json)"
"TCP","66","0.073054","8000  50048 [ACK] Seq=1 Ack=215 Win=30080 Len=0 TSval=1397333572 TSecr=837790001"
"TCP","83","0.078404","[TCP segment of a reassembled PDU]"
"TCP","66","0.078473","50048  8000 [ACK] Seq=215 Ack=18 Win=131744 Len=0 TSval=837790042 TSecr=1397333578"
"HTTP","365","0.079349","HTTP/1.0 200 OK  (application/json)"
"TCP","66","0.079418","50048  8000 [ACK] Seq=215 Ack=318 Win=131424 Len=0 TSval=837790042 TSecr=1397333578"
"TCP","66","0.079570","50048  8000 [FIN, ACK] Seq=215 Ack=318 Win=131424 Len=0 TSval=837790043 TSecr=1397333578"
"TCP","66","0.114651","8000  50048 [ACK] Seq=318 Ack=216 Win=30080 Len=0 TSval=1397333614 TSecr=837790043"

can you tell anything from the abnormal tcp package? What could be the reason why the application is not available? Next time there is a stiff situation, how to confirm whether this is the reason?


you can see that the first two handshake packages seem to be normal when the TCP connection is established, but from the third packet, you can find that the server does not seem to receive the third packet, so the server retransmits the SYN, ACK package several times in the middle, while the client also retransmits the ACK package to the server's SYN, ACK package several times. Finally, the connection timed out and the server reset the connection. It is not very clear what happened, you may need to grab a package on the server side.

< hr > Is

a connection problem that occurs after a period of time? Is it possible that the server is overloaded?


restart the python application and return to normal

that's most likely a client-side problem, and you should check the code in the application layer. For example, DNS parsing error.

Menu