Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Thrift lesson 8 abnormality of harsh environment

Shulou Source: shulou.com Published: 2022-06-03 05:17:57 10月05日 Update

1) due to no interaction for a long time, the channel is reclaimed by the router

The client did not detect the disconnection of the network connection, and the server-side exception was caught. The log output is as follows: TSocket::read () recv () errno = 10060

Error lookup 10060

The connection attempt failed because the connecting party did not reply correctly or the connected host did not respond after a period of time.

Knowledge expansion

TCP does not provide timely notification of lost connections, and heartbeats are required for applications that ensure a normal TCP connection in real time. Thrift is based on TCP connection, but it is not a real long connection. It can only be used in the stable and high-speed network environment within the system. In order to achieve a real long connection, you must manually add a heartbeat packet to the application. The current method is that the client sends a heartbeat packet regularly, and then the server receives it and returns the heartbeat packet directly. The client does not receive the heartbeat packet within 10 seconds, indicating that the connection is disconnected and reconnected.

2) Network exception

There are a large number of unreleased network connections on the server-side system. Check with netstat-na, and the connection status is CLOSE_WAIT

This problem is mainly due to the fact that the end process of the TCP has not been completed, resulting in the connection not being released. The client is now actively disconnected. The process is as follows

Client message Server

Close ()

-FIN->

FIN_WAIT1 CLOSE_WAIT

Tags: Client client server status network service application one end application process program end system problem environment initiative image above host Julian Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Xiaomi Redmi Docker