Skip to content

Calling removeEntries on system store throws ConcurrentModificationException  #278

@earocorn

Description

@earocorn

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions