We're updating the issue view to help you get more done. 

Clarify errors when interrupted during submission of work to the ES client

Description

I noticed that this interruption error is not that exceptional; essentially it might happen at any time one stops the application. Sure it might mean there's some data loss, so we should warn about this but I'd resort to a traditional WARN in the logs rather than the whole stacktrace.

Details:
method org.hibernate.search.elasticsearch.processor.impl.BatchingSharedElasticsearchWorkOrchestrator.submit(Iterable<ElasticsearchWork<?>>)

Causes expceptions like:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 org.hibernate.search.exception.SearchException: Interrupted while submitting a changeset to the queue at org.hibernate.search.elasticsearch.processor.impl.BatchingSharedElasticsearchWorkOrchestrator.submit(BatchingSharedElasticsearchWorkOrchestrator.java:93) at org.hibernate.search.elasticsearch.impl.ElasticsearchIndexManager.performOperations(ElasticsearchIndexManager.java:449) at org.hibernate.search.backend.impl.LocalBackendQueueProcessor.applyWork(LocalBackendQueueProcessor.java:58) at org.hibernate.search.backend.impl.WorkQueuePerIndexSplitter.commitOperations(WorkQueuePerIndexSplitter.java:66) at org.hibernate.search.backend.impl.TransactionalOperationDispatcher.dispatch(TransactionalOperationDispatcher.java:72) at org.hibernate.search.backend.impl.BatchedQueueingProcessor.performWorks(BatchedQueueingProcessor.java:72) at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:76) at org.hibernate.search.testsupport.setup.TransactionContextForTest.end(TransactionContextForTest.java:45) at org.hibernate.search.engineperformance.elasticsearch.NonStreamWriteJMHBenchmarks.lambda$write$3(NonStreamWriteJMHBenchmarks.java:74) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204) at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812) 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.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.hibernate.search.engineperformance.elasticsearch.NonStreamWriteJMHBenchmarks.write(NonStreamWriteJMHBenchmarks.java:60) at org.hibernate.search.engineperformance.elasticsearch.NonStreamWriteJMHBenchmarks.readWriteTestWriter(NonStreamWriteJMHBenchmarks.java:108) at org.hibernate.search.engineperformance.elasticsearch.generated.NonStreamWriteJMHBenchmarks_concurrentReadWriteTest_jmhTest.concurrentReadWriteTest_Throughput(NonStreamWriteJMHBenchmarks_concurrentReadWriteTest_jmhTest.java:219) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:453) at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:437) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220) at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335) at java.util.concurrent.ArrayBlockingQueue.put(ArrayBlockingQueue.java:350) at org.hibernate.search.elasticsearch.processor.impl.BatchingSharedElasticsearchWorkOrchestrator.submit(BatchingSharedElasticsearchWorkOrchestrator.java:89)

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major