-
Notifications
You must be signed in to change notification settings - Fork 8k
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
With gin v1.8.0, gin.Context is canceled within goroutine #3166
Comments
In my humble opinion, the root cause of this issue is #2769 |
we are seeing issues with this as well. I have now reverted 1.8.0 from quite many services. |
I have a proposal |
Maybe, but I think this kind of evolution can't be done in MINOR version change ( |
@thinkerou What do you think about this? The following is my proposal.
|
@appleboy approve 2, the pr solved Trusted Proxies issue. |
@wei840222 Can you make a new PR to resolve the issue? |
@appleboy Yes I can |
Fixed in #3172 |
@appleboy to make it clear. What should be the value for feature flag to have same behaviour than it was before 1.8.0? False or True? |
False and since it is default value. So you don't need to change anything in your code base in order to have the same behavior of pre v1.8.0
…_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
|
Though this has been fixed, I personally think the OP is not using context properly. If you kick off a background task running beyond the lifetime of the HTTP request being served, then it should get its own context rooted at |
Description
With gin v1.8.0, the
gin.Context
is canceled when we use it within goroutine for doing async task (so this task can be executed after the reply to http client that doing request on gin router). This is big breaking change in regard of gin v1.7How to reproduce
This test below is red with gin v1.8.0 but it was green with v1.7.7.
Expectations
With gin v1.8.0, the provided test must be green
Actual result
With gin v1.8.0, the provided test is red
Environment
The text was updated successfully, but these errors were encountered: