diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 241eb8f4ca8..1fa49966344 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -25,7 +25,6 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader.CacheHelper; import org.apache.lucene.store.AlreadyClosedException; -import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.util.CollectionUtil; import org.apache.lucene.util.RamUsageEstimator; import org.elasticsearch.ElasticsearchException; @@ -806,7 +805,7 @@ public class IndicesService extends AbstractLifecycleComponent nodeEnv.deleteIndexDirectorySafe(index, 0, indexSettings); } success = true; - } catch (LockObtainFailedException ex) { + } catch (ShardLockObtainFailedException ex) { logger.debug(() -> new ParameterizedMessage("{} failed to delete index store - at least one shards is still locked", index), ex); } catch (Exception ex) { diff --git a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index 5e8e8e6ec95..11b7f03da10 100644 --- a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -22,7 +22,6 @@ package org.elasticsearch.indices.cluster; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.apache.lucene.store.LockObtainFailedException; import org.elasticsearch.ResourceAlreadyExistsException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.replication.ReplicationResponse; @@ -354,7 +353,7 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent imple // holding on to the lock due to a "currently canceled recovery" or so. The shard will delete itself BEFORE the // lock is released so it's guaranteed to be deleted by the time we get the lock indicesService.processPendingDeletes(index, indexSettings, new TimeValue(30, TimeUnit.MINUTES)); - } catch (LockObtainFailedException exc) { + } catch (ShardLockObtainFailedException exc) { logger.warn("[{}] failed to lock all shards for index - timed out after 30 seconds", index); } catch (InterruptedException e) { logger.warn("[{}] failed to lock all shards for index - interrupted", index);