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

Make ElasticsearchWorkProcessor use one execution context per runnable once again

Description

Following HSEARCH-2652, we have this code:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SequentialWorkExecutionContext context = new SequentialWorkExecutionContext( client, gsonProvider, workFactory, ElasticsearchWorkProcessor.this, errorHandler ); synchronized ( asyncProcessor ) { while ( true ) { Iterable<Iterable<ElasticsearchWork<?>>> works = asyncProcessor.asyncWorkQueue.drainToDetachedIterable(); if ( works == null ) { // Allow other async processors to be setup already as we're on our way to termination: asyncProcessor.asyncWorkerWasStarted.set( false ); // Nothing more to do, flush and terminate: context.flush(); return; } Iterable<ElasticsearchWork<?>> flattenedWorks = CollectionHelper.flatten( works ); executeSafe( flattenedWorks, false ); }

context is not used anywhere, there's something wrong. It should be used in executeSafe.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Components

Fix versions

Priority

Major