-
Notifications
You must be signed in to change notification settings - Fork 3
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
load: ignore context cancel error #64
Conversation
@unknwon sorry to bother you, but do you have time to review this pr? |
Apologies for the delay, will take a look today! |
If I understand your ask correctly, you may want to look at https://flamego.dev/core-services.html#response-stream for how to archive that. TL;DR as soon as a status code is being written, subsequent handlers won't be called. |
I know about this feature, and that's why I added |
I think there should be some problem with my modification, if you can explain the correct workflow, I can make a modification. |
I just committed a suggestion, I think things should work as expected now. |
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.
Thanks for the PR!
I'm gonna merge and release a new patch version. If you have any other suggestions that are not included, we can always work on a followup PR, since this one is purely beneficial. |
https://github.com/flamego/session/releases/tag/v1.2.2 has been created for this merge. |
Thanks for reviewing. |
Describe the pull request
I recently noticed the error
session: load: read: get: context canceled
in my sentry panel.I traced the error into this package and found that it will panic when the user closes the connection.
Actually, there are some fixes applied in line 188 but it is not enough.
Because the context canceled before the next handlers, I use
c.ResponseWriter().WriteHeader(0)
to end this handler chain.By the way, I am looking forward flamego support the method like
Abort()
in gin to prevents pending handlers from being called.Link to the issue: n/a
Checklist