Skip to content
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

[CURATOR-493] Fix test case with testDeleteChildrenConcurrently #291

Merged
merged 1 commit into from
Dec 9, 2018
Merged

[CURATOR-493] Fix test case with testDeleteChildrenConcurrently #291

merged 1 commit into from
Dec 9, 2018

Conversation

he7g
Copy link
Contributor

@he7g he7g commented Dec 9, 2018

Link #235

if ( stat == null )
{
// the thread client has begin deleted the children
threadDeleted = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this? Once it is set, checkExists() is never called again. That seems incorrect. I removed this and the test still passes. Can you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that judge the new thread is running at the loop that is deleting children:
ZKPaths.java , 341 line

        for ( String child : children )
        {
            String fullPath = makePath(path, child);
            deleteChildren(zookeeper, fullPath, true);
        }

and then, the main thread is try to delete some child that is still not deleted by the new thread. If the main thread delete child successfully, the new thread should not throw NoNodeException, but the old version will throw NoNodeException and cause the remaining children are not deleted, that's the bug situation.

So, it's unnecessary to checkExists() after that threadDeleted is true. I just want the main thread delete a child successfully, when the new thread is deleting children.

@asfgit asfgit merged commit 05f6a56 into apache:master Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants