brpc icon indicating copy to clipboard operation
brpc copied to clipboard

[Feature Proposal] avoid tcp reset warn log for specific sub net

Open hiberabyss opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

Currently, aliyun periodically do http health check for the service run by brpc. The health check send rst package instead of fin after get the http response, which will cause following warn logs:

W20231117 06:09:57.326679    44 input_messenger.cpp:375] Fail to read from Socket{id=1065151891020 fd=63 addr=100.120.171.0:64081:8089} (0x7ff894049dc0): Connection reset by peer [104]
W20231117 06:09:58.451676    43 input_messenger.cpp:375] Fail to read from Socket{id=1194000909256 fd=72 addr=100.121.119.129:49771:8089} (0x7ff8a403e600): Connection reset by peer [104]

Describe the solution you'd like (描述你期望的解决方法)

Avoid the warn logs for the aliyun health check requests.

Describe alternatives you've considered (描述你想到的折衷方案)

Two possible solutions:

  1. Have a flag which control whether close the socket directly for health check connections.
  2. User could specify sub networks whose connection warn log will be skipped.

Are the solutions reasonable? What's your suggestions?

Looking forward to your response.

Additional context/screenshots (更多上下文/截图)

hiberabyss avatar Nov 17 '23 06:11 hiberabyss

可以提个pr

Huixxi avatar Nov 25 '23 11:11 Huixxi