fix: connections overflow when command processing takes too long and clients close connection#3089
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
24c81e5 to
a08be8e
Compare
…lient close connection
a08be8e to
e4f95cf
Compare
…lient close connection (OpenAtomFoundation#3089) Co-authored-by: wangshaoyi <[email protected]>
pika服务端在收到一个完整的redis请求之后会关闭可读事件的唤醒。
特殊情况下,比如存量数据很多,用户使用了scan接口导致请求在服务端处理耗时达到了几十秒,此时如果用户代码中设置了超时,那么连接会被客户端关闭,但服务端直到命令处理完才会再次注册connfd相关事件,所以导致服务端积累了大量的close_wait连接,最终可能会达到pika设定的连接数上线从而停止接收新的建连请求。