-
Notifications
You must be signed in to change notification settings - Fork 55
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: epoll socket async chaining and refactor #374
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: kostas <[email protected]>
@romange Fixes the test case as well in DF. I could add a test here but that's something I will be doing anyway when I push my |
delete async_request; | ||
async_request = nullptr; | ||
if (is_send) | ||
async_write_pending_ = 0; |
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.
Cause lambdas can't capture and use bitfields 😮💨
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #374 +/- ##
==========================================
+ Coverage 77.60% 77.92% +0.31%
==========================================
Files 103 108 +5
Lines 7824 8972 +1148
==========================================
+ Hits 6072 6991 +919
- Misses 1752 1981 +229 ☔ View full report in Codecov by Sentry. |
delete async_read_req_; | ||
async_read_req_ = nullptr; | ||
async_read_pending_ = 0; | ||
auto body = [&ec, this](bool is_send) { |
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.
since it captures this
, please make it a member function that returns error_code
.
@@ -166,22 +166,18 @@ bool EpollSocket::AsyncReq::Run(int fd, bool is_send) { | |||
res = is_send ? sendmsg(fd, &msg, MSG_NOSIGNAL) : recvmsg(fd, &msg, 0); | |||
|
|||
if (res > 0) { | |||
cb(res); | |||
return true; | |||
return {true, res}; |
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.
what is the reason for moving cb() outside of AsyncReq::Run?
Fixes the problem described in dragonflydb/dragonfly#4498 and here dragonflydb/dragonfly#4498 (comment)