TAMULib / SAGE

Search Aggregation Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Read and Writer Operation fails on concurrent error.

kaladay opened this issue · comments

Describe the bug
The logs show

java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
	at java.base/java.util.ArrayList$Itr.next(Unknown Source)
	at org.apache.solr.common.SolrInputField.addValue(SolrInputField.java:92)
	at org.apache.solr.common.SolrInputDocument.addField(SolrInputDocument.java:103)
	at edu.tamu.sage.service.SimpleProcessorService.lambda$writeSolrCore$1(SimpleProcessorService.java:163)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at edu.tamu.sage.service.SimpleProcessorService.lambda$writeSolrCore$2(SimpleProcessorService.java:160)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at edu.tamu.sage.service.SimpleProcessorService.writeSolrCore(SimpleProcessorService.java:157)
	at edu.tamu.sage.service.SimpleProcessorService.lambda$process$4(SimpleProcessorService.java:230)
	at java.base/java.lang.Iterable.forEach(Unknown Source)
	at edu.tamu.sage.service.SimpleProcessorService.lambda$process$5(SimpleProcessorService.java:230)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

This is a concurrency problem the way in which java.lang.Iterable.forEach is used.

To Reproduce
Steps to reproduce the behavior:

  1. Create a fedore reader, a sage writer, and an operation that uses the reader and writer.
  2. Run the operation.
  3. See error in system console.

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Java docs state the following:

void java.lang.Iterable.forEach(Consumer<? super String> action)

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.

This might be schema related.
The major changes to the schema may have resulted in problem this no longer surfacing.

No longer able to reproduce.