Uploaded image for project: 'Hibernate Search'
  1. Hibernate Search
  2. HSEARCH-2767

Make ElasticsearchWorkProcessor use one execution context per runnable once again

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.8.0.Beta3
    • Component/s: elasticsearch
    • Labels:
      None

      Description

      Following HSEARCH-2652 Closed , 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.

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              yrodiere Yoann Rodière
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: