-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-2891: Invalid processing of zookeeper_close for mutli-request #999
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
Conversation
|
Hello! This is a reworked/updated/improved PR. The previous one: #360 |
eolivelli
left a comment
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.
Thos change makes sense to me.
I do not have so much experience with c client, so I can't say we are covering all of the aspects of this problem.
As said in another PR we should add a test to demonstrate the problem and verify that we have fixed it.
I will let other reviewers tell their opinion
Thanks
Done! I have provided two tests:
The reason to have namely two tests is about the same as for ZOOKEEPER-2894 (see #1000). So, it's just two subcases of the same problem. Note: Right now, the first test of two is temporarily disabled because it requires fixes from ZOOKEEPER-2894. When it's merged, I'll rebase this PR and enable this test. Ok, BEFORE this patch both tests fail with And after the patch both tests pass successfully (again, for the first test, assuming ZOOKEEPER-2894 is already merged).
What is the alternative??
If we put
Currently 'yes', because there is nothing between the while-loop-body-end and the final |
|
rebased on 4a5d596 |
1711b07 to
e2b1cd7
Compare
|
|
@phunt @anmolnar @eolivelli @hanm Hello! It looks, I'm ready with this patch too. But I have three questions:
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/4058/console Thank you! |
bc321e7 to
707aa4e
Compare
|
Rebased on |
14185de to
1e47602
Compare
|
Resolved "stack smashing detected" in // the reason was locally allocated Now it works fine. What happened with junit tests? |
|
... hmmm, maybe it's better to wait for #1030 |
This is a backport of #717 to `branch-3.4` For some reason it was NOT merged to `branch-3.4`, but only to `branch-3.5` and `master`: - 4bd32be - b1fd480 Here, it's almost a cherry-pick of the original patch, but slightly adopted to specific of `branch-3.4`. Namely, `cleanup_failed_multi()` and `deserialize_multi()` do not have the first parameter `zhandle_t *zh`. ---- I wish to backport this also to use it as the base for my #999 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Andor Molnár <andor@apache.org>, Michael Han <hanm@apache.org> Closes #1030 from xoiss/ZOOKEEPER-1636
|
rebased Hello! As it turned out, #1030, #717 (ZOOKEEPER-1636) is 100% enough to close ZOOKEEPER-2891 also. And as soon as #1030, #717 cover the more common case (general "unsuccessful status", but not only ZCLOSING), and #717 is already in the // Many thanks to @mkedwards for his idea given in #717 ! Hence, there are two unit-tests proposed in this PR. If you wish, we can merge them into // I've edited this PR. Namely, I've removed patches to the Client code, but left only two unit-tests. So, this PR now contains only unit-tests. |
|
^ up |
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes #999 from xoiss/ZOOKEEPER-2891
|
merged to 3.4. Please close the pr @xoiss |
|
@xoiss I haven't noticed that this one targets 3.4, sorry. The usual way of contributions is to create patch for master first that we can cherry-pick to other branches, not the other way around. Let me take care of this. |
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes #999 from xoiss/ZOOKEEPER-2891
|
Cherry-picked to master and 3.5 branches. |
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes apache#999 from xoiss/ZOOKEEPER-2891
Yes, I've got it. Ok, with this commit, it's the whole amount of patches I had. |
|
@xoiss Thanks for the contribution. |
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes apache#999 from xoiss/ZOOKEEPER-2891
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes apache#999 from xoiss/ZOOKEEPER-2891
When I call `zookeeper_close()` while there is a pending multi request, I expect the request completes with `ZCLOSING` status. But with the existing code I actually get the following: * the program exits with `SIGABRT` from `assert(entry)` in `deserialize_multi()` * and even if I remove this assertion and just break the enclosing loop, the returned status is `ZOK` but not `ZCLOSING` So, there are two defects with processing calls to `zookeeper_close()` for pending multi requests: improper assertion in implementation and invalid status in confirmation. Proposed changes remove these defects. For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891 Author: Alexander A. Strelets <streletsaa@gmail.com> Reviewers: Michael Han <hanm@apache.org> Closes apache#999 from xoiss/ZOOKEEPER-2891
When I call
zookeeper_close()while there is a pending multi request, I expect the request completes withZCLOSINGstatus.But with the existing code I actually get the following:
SIGABRTfromassert(entry)indeserialize_multi()ZOKbut notZCLOSINGSo, there are two defects with processing calls to
zookeeper_close()for pending multi requests: improper assertion in implementation and invalid status in confirmation.Proposed changes remove these defects.
For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2891