bug record - socket hang up

The cause of the bug

In the lightweight backend service built by node (the main function is to forward requests and undertake part of data processing), some time-consuming interfaces will generate this error, which means that they are closed before the interface request is completed.

I checked the reason, because the httpServer of nodejs has a default timeout of two minutes, that is, if the response time of an interface in node exceeds two minutes, the connection will be closed.

Solution

Set the timeout time of httpServer a little longer or set it to 0 to keep the connection

Guess you like

Origin blog.csdn.net/qq_52965813/article/details/128198719