-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: set error response for timeout request #3069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.5
Are you sure you want to change the base?
feat: set error response for timeout request #3069
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:
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 (
|
| return bc.setResponse(r, nil, fmt.Errorf("backend conn failure, %s", err)) | ||
| } | ||
|
|
||
| if timeout_resp_cnt != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该先处理当前响应,再减少timeout计数。过早的continue会导致即使后续请求成功,客户端也无法收到响应结果。
之前的codis proxy 中,如果后端服务读请求超时,对应链接会close重新创建新链接,对应链接上的请求会直接失败。
修改之后,如果请求超时,只会将对应的request设置为err,不会kill链接。