Catch Throwable rather than Exception if latches are present.

This commit is contained in:
Simon Willnauer 2013-08-12 17:38:30 +02:00
parent 8a876ea80e
commit 82d3693a91
3 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ public class MetaDataDeleteIndexService extends AbstractComponent {
// wait for events from all nodes that it has been removed from their respective metadata... // wait for events from all nodes that it has been removed from their respective metadata...
int count = currentState.nodes().size(); int count = currentState.nodes().size();
// add the notifications that the store was deleted from *date* nodes // add the notifications that the store was deleted from *data* nodes
count += currentState.nodes().dataNodes().size(); count += currentState.nodes().dataNodes().size();
final AtomicInteger counter = new AtomicInteger(count); final AtomicInteger counter = new AtomicInteger(count);
final NodeIndexDeletedAction.Listener nodeIndexDeleteListener = new NodeIndexDeletedAction.Listener() { final NodeIndexDeletedAction.Listener nodeIndexDeleteListener = new NodeIndexDeletedAction.Listener() {

View File

@ -265,7 +265,7 @@ public class InternalIndexService extends AbstractIndexComponent implements Inde
public void run() { public void run() {
try { try {
removeShard(shardId, reason); removeShard(shardId, reason);
} catch (Exception e) { } catch (Throwable e) {
logger.warn("failed to close shard", e); logger.warn("failed to close shard", e);
} finally { } finally {
latch.countDown(); latch.countDown();

View File

@ -152,7 +152,7 @@ public class InternalIndicesService extends AbstractLifecycleComponent<IndicesSe
public void run() { public void run() {
try { try {
removeIndex(index, "shutdown", shardsStopExecutor); removeIndex(index, "shutdown", shardsStopExecutor);
} catch (Exception e) { } catch (Throwable e) {
logger.warn("failed to delete index on stop [" + index + "]", e); logger.warn("failed to delete index on stop [" + index + "]", e);
} finally { } finally {
latch.countDown(); latch.countDown();