-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Problem: REP leaves label msgs for dead REQ in pipe #2572
Conversation
Solution: roll back the pipe if writing messages other than the first fails in router::xsend. Also add test case that reproduces the memory leak when ran with valgrind. Fixes zeromq#2567
@somdoron I think this is the right thing to do, but I could be missing something, could you please have a quick look when you have time? |
I think the fix is incorrect, take a look at the pipe terminated method, current out will be null and all msg will be dropped (future and past) |
Thanks, will look again |
@somdoron |
Ok Sorry, I'm surprised we only find out about this now. Also calling rollback in the router version is a mistake because it set the more_out to false, which is not what we want here (because it is a silent drop, setting more_out to false will cause an error on the next part, which the router will think is a routing id). So I would just call outpipe.rollback() in both places. |
What I've discovered in my test:
|
I'm also not sure why there's |
Thanks for the comments&insights As far as I can see, setting current_out to NULL in xsend has been around since forever, I can trace it back to before router.cpp existed, in xrep: b79d07b
Note that I intentionally called outpipe's rollback rather than router for this reason, already in this diff. So if I followed correctly, the proposal is to resend this same PR, with the addition of calling pipe_->rollback() in xpipe_terminated ? |
Yes
On May 17, 2017 12:23 AM, "Luca Boccassi" <notifications@github.com> wrote:
Thanks for the comments&insights
As far as I can see, setting current_out to NULL in xsend has been around
since forever, I can trace it back to before router.cpp existed, in xrep:
b79d07b
<b79d07b>
Also calling rollback in the router version is a mistake because it set the
more_out to false, which is not what we want here (because it is a silent
drop, setting more_out to false will cause an error on the next part, which
the router will think is a routing id).
Note that I intentionally called outpipe's rollback rather than router for
this reason, already in this diff.
So if I followed correctly, the proposal is to resend this same PR, with
the addition of calling pipe_->rollback() in xpipe_terminated ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2572 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AClv9n6U_bUAOEu5mzT9cEPdnKvM_pMqks5r6hPmgaJpZM4NXVKd>
.
|
Here it is: #2577 |
Solution: roll back the pipe if writing messages other than the
first fails in router::xsend.
Also add test case that reproduces the memory leak when ran with
valgrind.
Fixes #2567