Make ElasticsearchWorkProcessor use one execution context per runnable once again

Description

Following HSEARCH-2652, we have this code:

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.

Activity

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created June 8, 2017 at 5:45 PM
Updated June 13, 2017 at 10:38 AM
Resolved June 8, 2017 at 9:44 PM

Flag notifications