ConcurrentModificationException when CLI finishes and SOLR document handler still working

Description

In 2017-07-SNAPSHOT, run
mycore.sh rebuild solr metadata index
...
finishes with

2018-03-29T14:24:19,272 INFO SYSTEM MCRSolrInputDocumentHandler: Sending ubo_mods_00001137 to SOLR...
Exception in thread "MCR-exit" java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1353)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findAny(ReferencePipeline.java:469)
at org.mycore.solr.index.MCRSolrIndexer$1.prepareClose(MCRSolrIndexer.java:118)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:373)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.mycore.common.events.MCRShutdownHandler.shutDown(MCRShutdownHandler.java:125)
at org.mycore.common.events.MCRShutdownThread.run(MCRShutdownThread.java:56)
2018-03-29T14:24:19,275 INFO SYSTEM MCRSolrInputDocumentHandler: Sending ubo_mods_00001092 to SOLR...

Environment

None

Assignee

Matthias Eichner

Reporter

Frank L├╝tzenkirchen

Labels

None

URL

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Highest
Configure