Restore interrupt status when InterruptedException is caught

This commit is contained in:
Simon Willnauer 2015-06-15 09:40:28 +02:00
parent 87f0d09ace
commit 9210aeacea
1 changed files with 2 additions and 0 deletions

View File

@ -390,12 +390,14 @@ public class InternalClusterInfoService extends AbstractComponent implements Clu
try { try {
nodeLatch.await(fetchTimeout.getMillis(), TimeUnit.MILLISECONDS); nodeLatch.await(fetchTimeout.getMillis(), TimeUnit.MILLISECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // restore interrupt status
logger.warn("Failed to update node information for ClusterInfoUpdateJob within 15s timeout"); logger.warn("Failed to update node information for ClusterInfoUpdateJob within 15s timeout");
} }
try { try {
indicesLatch.await(fetchTimeout.getMillis(), TimeUnit.MILLISECONDS); indicesLatch.await(fetchTimeout.getMillis(), TimeUnit.MILLISECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); // restore interrupt status
logger.warn("Failed to update shard information for ClusterInfoUpdateJob within 15s timeout"); logger.warn("Failed to update shard information for ClusterInfoUpdateJob within 15s timeout");
} }