Skip to content

Commit

Permalink
fix corner case issue when stop is called while a next search is sche…
Browse files Browse the repository at this point in the history
…duled
  • Loading branch information
Hendrik Muhs committed Apr 14, 2020
1 parent b9512db commit 7c55d35
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,12 @@ protected void nextSearch() {
logger.debug("throttling job [{}], wait for {} ({} {})", getJobId(), executionDelay, maximumRequestsPerSecond,
lastDocCount);
scheduledNextSearch = threadPool.schedule(() -> triggerNextSearch(), executionDelay, executorName);

// corner case: if for whatever reason stop() has been called meanwhile fast forward
if (getState().equals(IndexerState.STOPPING)) {
triggerThrottledSearchNow();
}

return;
}
}
Expand Down

0 comments on commit 7c55d35

Please sign in to comment.