See MutableFactoryTest.testMultiThreadedAddClasses, which seems to frequently fail with the stack trace below. It seems there is an issue with refreshes. In BackendRequestProcessor, we have this code:
private ExecutableRequest build(boolean refresh) {
if ( size > 1 ) {
return new BulkRequest( jestClient, errorHandler, bulk, indexNames, indexesNeedingRefresh, refresh );
}
else {
return new SingleRequest( jestClient, errorHandler, bulk.iterator().next() );
}
}
... which totally ignores the "refresh" parameter for single requests. Since the "refresh" flag is not set by default on requests created by ElasticsearchIndexWorkVisitor.indexDocument, we probably skip some refreshes sometimes. Note that once this is fixed, other errors seem to occur: calls to the "refresh" API that fail because of unexisting indexes... To be investigated. For now, MutableFactoryTest.testMultiThreadedAddClasses has been disabled for Elasticsearch. It should be re-enabled once this issue has been fixed.
java.lang.AssertionError: Unexpected failure on thread #3
at org.hibernate.search.test.configuration.mutablefactory.MutableFactoryTest.testMultiThreadedAddClasses(MutableFactoryTest.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Suppressed: java.lang.AssertionError: Should have exactly one result for 'Emmanuel20' expected:<1> but was:<0>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
at org.junit.Assert.assertEquals(Assert.java:645)
at org.hibernate.search.test.configuration.mutablefactory.MutableFactoryTest$DoAddClasses.run(MutableFactoryTest.java:317)
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:745)
Caused by: org.hibernate.search.exception.SearchException: HSEARCH400007: Elasticsearch request failed.
Request:
========
Operation: Search
URI:org.hibernate.search.test.configuration.mutablefactory.generated.generated%24a15/_search?from=0&size=10000
Data:
{"query":{"bool":{"must":{"term":{"name":{"value":"emmanuel15"}}},"filter":{"type":{"value":"org.hibernate.search.test.configuration.mutablefactory.generated.Generated$A15"}}}},"_source":["id"]}
Response:
=========
Status: 404
Error message: {"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"org.hibernate.search.test.configuration.mutablefactory.generated.generated$a15","index":"org.hibernate.search.test.configuration.mutablefactory.generated.generated$a15"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"org.hibernate.search.test.configuration.mutablefactory.generated.generated$a15","index":"org.hibernate.search.test.configuration.mutablefactory.generated.generated$a15"}
Cluster name: null
Cluster status: 404
at org.hibernate.search.elasticsearch.client.impl.JestClient.executeRequest(JestClient.java:141)
at org.hibernate.search.elasticsearch.client.impl.JestClient.executeRequest(JestClient.java:115)
at org.hibernate.search.elasticsearch.impl.ElasticsearchHSQueryImpl$IndexSearcher.search(ElasticsearchHSQueryImpl.java:738)
at org.hibernate.search.elasticsearch.impl.ElasticsearchHSQueryImpl$IndexSearcher.search(ElasticsearchHSQueryImpl.java:692)
at org.hibernate.search.elasticsearch.impl.ElasticsearchHSQueryImpl.execute(ElasticsearchHSQueryImpl.java:295)
at org.hibernate.search.elasticsearch.impl.ElasticsearchHSQueryImpl.queryResultSize(ElasticsearchHSQueryImpl.java:186)
at org.hibernate.search.test.configuration.mutablefactory.MutableFactoryTest$DoAddClasses.run(MutableFactoryTest.java:317)
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:745)
|