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

replicatedmap.destroy() goes into an infinite loop #6754

Closed
eminn opened this issue Nov 17, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@eminn
Copy link
Collaborator

commented Nov 17, 2015

destroyDistributedObject() method on ReplicatedMapService iterates over partition containers and record stores and destroys them. While destroying, record store calls destroyDistributedObject() which leads to an infinite loop.

@pveentjer

This comment has been minimized.

Copy link
Member

commented Nov 17, 2015

How can it end in an infinite loop because the object is removed from the partition before it gets destroyed.

  public void destroy(String name) {
        ReplicatedRecordStore replicatedRecordStore = replicatedStorages.remove(name);
        if (replicatedRecordStore != null) {
            replicatedRecordStore.destroy();
        }

    }

So if replicatedRecordStore.destroy() leads to a call to ReplicatedMapService, the loop will be broken because the second time the ReplicatedMapService.destroy is called, the replicatedRecordStore doesn't exist anymore and therefor there is no recursion.

Or am I wrong?

@eminn

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 17, 2015

You are right about that, the loop is broken at some point but even if so, the call to replicated map service leads to unnecessary iteration of partition containers again and again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.