-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Request context canceled during graceful shutdown #3096
Comments
🤖 Hello @LinEvil, I'm Dosu, an AI bot here to assist you with Kratos. While we wait for a human maintainer, I'll do my best to help you solve bugs, answer questions, and guide you on your journey as a contributor. Let's tackle this together! Thank you for the detailed report. I understand that you're experiencing an issue where the context of a request is being canceled during a graceful shutdown, even though you expect the request to be processed normally unless it reaches the You've correctly identified that this issue is similar to two previously solved issues in the Kratos repository: graceful shutdown err and [Question] 服务优雅退出. Both of these issues were related to the context being canceled during a graceful shutdown, and they were resolved by modifying the way the context is managed during the shutdown process. You've also pointed out that the issue seems to have reappeared in version v2.5.3, after the introduction of the feature #2403. This feature changed the Based on your description, it seems that the change to the However, without more information, it's difficult to say for certain what the best solution would be. It's possible that the change to the I would recommend creating a new issue in the Kratos repository to report this problem. Be sure to include all the details you've provided here, as well as any additional information you think might be relevant. The maintainers of the Kratos repository will be able to help you find the best solution. I hope this helps, and please let me know if you have any other questions. Sources |
If you already have a solution, you can directly submit a PR |
Need review |
What happened:
Logs:
What you expected to happen:
The context of the request should not be canceled, and any request before executing a graceful shutdown should be processed normally unless the request time reaches
http.timeout
or shutdown time reachesstopTimeout
.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The issue is similar to #1856, which was fixed in v2.2.1 (#1873 #1895).
My case works fine between v2.2.1 and v2.5.2
Since v2.5.3, the feature #2403 changed
srv.Start(context)
, which may cause the current issue.I tried rolling back that line and the problem was fixed, but I'm not sure if this is right.
Environment:
kratos -v
): v2.7.1go version
): go1.21.4cat /etc/os-release
): WindowsThe text was updated successfully, but these errors were encountered: