Adding classes to the SearchIntegrator concurrently fails with Elasticsearch

Description

See MutableFactoryTest.testMultiThreadedAddClasses, which seems to frequently fail with the stack trace below.

For now, MutableFactoryTest.testMultiThreadedAddClasses has been disabled for Elasticsearch. It should be re-enabled once this issue has been fixed.

Previous analysis (wrong)

It seems there is an issue with refreshes. In BackendRequestProcessor, we have this code:

... 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.

Actual cause

See https://github.com/hibernate/hibernate-search/pull/1230

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Critical
Configure