From 48ae88128766a602a5c233eacb7f6e3195323d7d Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Thu, 30 Aug 2012 12:19:10 +0000 Subject: [PATCH] SOLR-3721: Fix bug that could allow multiple recoveries to run briefly at the same time if the recovery thread join call was interrupted. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1378904 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 4 ++++ .../org/apache/solr/update/DefaultSolrCoreState.java | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 134374951db..5e3939f4388 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -90,6 +90,10 @@ Bug Fixes * SOLR-3770: Overseer may lose updates to cluster state (siren) +* SOLR-3721: Fix bug that could allow multiple recoveries to run briefly at + the same time if the recovery thread join call was interrupted. + (Per Steffensen, Mark Miller) + Other Changes ---------------------- diff --git a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java index 6a53ed5e763..174e0d34114 100644 --- a/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java +++ b/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java @@ -242,10 +242,14 @@ public final class DefaultSolrCoreState extends SolrCoreState { synchronized (recoveryLock) { if (recoveryStrat != null) { recoveryStrat.close(); - try { - recoveryStrat.join(); - } catch (InterruptedException e) { - + while (true) { + try { + recoveryStrat.join(); + } catch (InterruptedException e) { + // not interruptible - keep waiting + continue; + } + break; } recoveryRunning = false;