Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2195 - Have client-driven reindex exit if no work to do #2567

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ public void monitorLoop() {
if (currentThreadCount == 0) {
// Nothing currently running, so make one test call to verify things are working
doneRetrieving = doneRetrieving || !callRetrieveIndex();
if (!blockingQueue.isEmpty()) {
if (blockingQueue.isEmpty()) {
// Do not even start the worker threads if nothing to do
logger.info("Nothing to do, so do not even start the worker threads");
this.running = false;
} else {
// Should be OK now to fill the pool with workers
logger.info("Index IDs available for processing - filling worker pool");
this.active = true;
Expand All @@ -176,7 +180,7 @@ public void monitorLoop() {
if (doneRetrieving) {
if (blockingQueue.isEmpty()) {
// Tell all the running threads they can stop now
logger.info("Nothing left to do, tell all the worker threads to exit");
logger.info("Nothing left to do, so tell all the worker threads to exit");
this.running = false;
} else {
// Worker threads are still processing, so sleep for a bit before we check again
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void testReindexFromTimestampDayTimeFormat() {
+ "-"
+ String.format("%02d", zdt.getMonthValue())
+ "-"
+ zdt.getDayOfMonth();
+ String.format("%02d", zdt.getDayOfMonth());

List<Parameter> parameters = new ArrayList<>();
parameters.add(Parameter.builder()
Expand Down