-
Notifications
You must be signed in to change notification settings - Fork 21
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 grpc crash #595
Fix grpc crash #595
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #595 +/- ##
===========================================
+ Coverage 56.51% 66.65% +10.13%
===========================================
Files 108 109 +1
Lines 10300 10771 +471
Branches 1402 1470 +68
===========================================
+ Hits 5821 7179 +1358
+ Misses 3894 2887 -1007
- Partials 585 705 +120 ☔ View full report in Codecov by Sentry. |
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.
now, before we append log, we will make sure that the data corresponding to this log is flushed and the rreq state is changed to DATA_WRITTEN.
so I am think can we remove the release data op in commit phase?
now, before we append log, we will make sure that the data corresponding to this log is flushed and the rreq state is changed to DATA_WRITTEN. so I am think can we remove the release data op in commit phrase? I think remove release data in req->clear() is a strength way to avoid double release --- actually my fix cannot guarantee the sequence 'data channel release -> append log->commit release', because I found another conflict:
And other way to guarantee the sequence is to add lock on release_data. cc: @JacksonYao287 @xiaoxichen @raakella1 |
@Besroy i think you mean here There are 3 places we do release_data()
conflicts between 1/3 and 2/3 can be resolved by either remove 3, or finish Conflict between 1/2 will not happen as |
58458db
58458db
to
ee90d97
Compare
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.
LGTM
If data channel and raft channel release the same data at the same time, there is a chance that send_response may be called twice, then grpc will crash with error TOO_MANY_OPERATIONS. This pr make sure data channel release data at first.
Signed-off-by: Yawen Zhang [email protected]