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

Calling removeEntries on system store throws ConcurrentModificationException #278

Open
earocorn opened this issue Nov 26, 2024 · 0 comments

Comments

@earocorn
Copy link

In DefaultSystemRegistry, you will receive a ConcurrentModificationException when calling removeEntries() with a System Filter to remove systems from a database. However, this issue does not occur if you remove the systems iteratively. This occurs in the registerDatabase() method and the exception does not throw when removing data streams or command streams, but only when removing systems.

systemStateDb.getDataStreamStore().removeEntries(dsFilter);
            systemStateDb.getCommandStreamStore().removeEntries(csFilter);
            var count = systemStateDb.getSystemDescStore().removeEntries(topLevelSystemsFilter);

            if (count > 0)
            List<ISystemWithDesc> procsToRemove = systemStateDb.getSystemDescStore().select(procFilter).collect(Collectors.toList());
            for(var proc : procsToRemove)
                systemStateDb.getSystemDescStore().remove(proc.getUniqueIdentifier());
//            var count = systemStateDb.getSystemDescStore().removeEntries(procFilter);

//            if (count > 0)
                log.info("Database #{} now handles system {}. Removing all records from state DB", db.getDatabaseNum(), uid);
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

No branches or pull requests

1 participant