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

Create one error context per set of works, instead of one per work, when processing Elasticsearch works

Description

In synchronous mode, it seems we create one error context per (potentially bulked) Elasticsearch work: see org.hibernate.search.elasticsearch.processor.impl.ElasticsearchWorkProcessor.executeSafely(Iterable<ElasticsearchWork<?>>) and org.hibernate.search.elasticsearch.processor.impl.ElasticsearchWorkProcessor.executeSafely(ElasticsearchWork<?>, ElasticsearchWorkExecutionContext).

We should instead create one error context per set of works that was submitted to the processor, so that the error context can also inform about which tasks were about to be executed, but will not be due to the error.

Note: we have the exact same issue when performing non-"stream" works in asynchronous mode; see https://github.com/hibernate/hibernate-search/pull/1336#pullrequestreview-29142895

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Minor