-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
fix Context loss when async invoke issue#13666 #15192
base: 3.3
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15192 +/- ##
============================================
+ Coverage 60.78% 60.79% +0.01%
- Complexity 10890 10894 +4
============================================
Files 1885 1885
Lines 86072 86077 +5
Branches 12892 12891 -1
============================================
+ Hits 52319 52334 +15
+ Misses 28306 28296 -10
Partials 5447 5447
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please write some tests to verify the current changes. |
@EarthChen PTAL |
// this is to fix https://github.com/apache/dubbo/issues/13666 | ||
this.responseFuture = this.responseFuture.thenApply((appResponse) -> { | ||
RestoreContext tempStoredContext = RpcContext.clearAndStoreContext(); | ||
this.storedContext.restore(); |
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.
Restore here might impact performance
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.
Should we just get the serverResponseLocal
in storedContext
directly? Or maybe we can have a flag in the RpcContext, once the user pass context into a thread, they should manually set this flag to true, then we will check the flag to decide whether add this thenApply
or not. I'm not sure which one is better. @AlbumenJ
What is the purpose of the change?
to fix issue #13666 in Dubbo Protocol (still has this issue in Triple)
How
Checklist