TCP high concurrency, RST connection cannot be released normally
Oracle
oraclelinux at foxmail.com
Sat May 31 04:32:08 EDT 2025
Problem description: Abnormal message appears in high-concurrency short connection, the server sends rst to the client, the client connection is closed, but the server connection that sends rst is still in ESTABLISHED state? What is the reason?
I captured some information through bpf and confirmed that the server sent rst and the client status changed to close. I tracked the failure return of tcp_v4_send_reset and tcp_rcv_state_process and found that TCP RST: ACK flag = 1, but the tcp state printed here is the listen state, which is not consistent with the current connection status viewed by netstat. (Not sure if some events are discarded), but the tcpdump packet capture analysis shows that the server is indeed rst and the connection is not released.
[root at systest104 zx]# netstat -atpn|grep 45129 |grep ES
tcp 0 0 10.13.8.104:45129 10.13.8.104:45052 ESTABLISHED 3942077/postgres: #The connection still exists
tcpdump:
02:58:06.494295 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
10.13.8.104.45129 > 10.13.8.104.45052: Flags [S.], cksum 0x2518 (incorrect -> 0x7ac8), seq 214961739, ack 2894898555, win 65535, options [mss 65495,sackOK,TS val 1670384838 ecr 1670384838,nop,wscale 11], length 0
02:58:06.496318 IP (tos 0x0, ttl 64, id 15240, offset 0, flags [DF], proto TCP (6), length 52)
10.13.8.104.45052 > 10.13.8.104.45129: Flags [.], cksum 0x2510 (incorrect -> 0xa39b), seq 65579, ack 39408264, win 32, options [nop,nop,TS val 1670384839 ecr 1670384838], length 0
02:58:06.496321 IP (tos 0x0, ttl 64, id 15241, offset 0, flags [DF], proto TCP (6), length 84)
10.13.8.104.45052 > 10.13.8.104.45129: Flags [P.], cksum 0x2530 (incorrect -> 0x2b50), seq 65579:65611, ack 39408264, win 32, options [nop,nop,TS val 1670384839 ecr 1670384838], length 32
02:58:06.497830 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)
10.13.8.104.45129 > 10.13.8.104.45052: Flags [R], cksum 0x0f95 (correct), seq 214961740, win 0, length 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20250531/045dc746/attachment.html>
More information about the Kernelnewbies
mailing list