One idea would be to add an argument such as BiConsumer<T, Throwable> asyncFailureReporter to the various submit methods in OperationSubmitter, so that the offloading submitter can mark the work as failed as necessary. For BatchingExecutor we’d use BatchedWork#markAsFailed, and for LuceneParallelWorkOrchestratorImpl we’d use a new method markAsFailed in org.hibernate.search.backend.lucene.orchestration.impl.LuceneParallelWorkOrchestratorImpl.WorkExecution.
|