|
26 | 26 | import org.elasticsearch.cluster.routing.RoutingTable; |
27 | 27 | import org.elasticsearch.cluster.routing.ShardRouting; |
28 | 28 | import org.elasticsearch.cluster.service.ClusterService; |
29 | | -import org.elasticsearch.core.Nullable; |
30 | 29 | import org.elasticsearch.common.component.AbstractLifecycleComponent; |
31 | 30 | import org.elasticsearch.common.inject.Inject; |
32 | 31 | import org.elasticsearch.common.settings.Settings; |
33 | | -import org.elasticsearch.core.TimeValue; |
34 | 32 | import org.elasticsearch.common.util.concurrent.AbstractRunnable; |
35 | 33 | import org.elasticsearch.common.util.concurrent.ConcurrentCollections; |
| 34 | +import org.elasticsearch.core.Nullable; |
| 35 | +import org.elasticsearch.core.TimeValue; |
36 | 36 | import org.elasticsearch.env.ShardLockObtainFailedException; |
37 | 37 | import org.elasticsearch.gateway.GatewayService; |
38 | 38 | import org.elasticsearch.index.Index; |
|
73 | 73 | import java.util.Objects; |
74 | 74 | import java.util.Set; |
75 | 75 | import java.util.concurrent.ConcurrentMap; |
76 | | -import java.util.concurrent.TimeUnit; |
77 | 76 | import java.util.function.BiConsumer; |
78 | 77 | import java.util.function.Consumer; |
79 | 78 |
|
@@ -313,14 +312,15 @@ public void onFailure(Exception e) { |
313 | 312 |
|
314 | 313 | @Override |
315 | 314 | protected void doRun() throws Exception { |
| 315 | + final TimeValue timeout = TimeValue.timeValueMinutes(30); |
316 | 316 | try { |
317 | 317 | // we are waiting until we can lock the index / all shards on the node and then we ack the delete of the store |
318 | 318 | // to the master. If we can't acquire the locks here immediately there might be a shard of this index still |
319 | 319 | // holding on to the lock due to a "currently canceled recovery" or so. The shard will delete itself BEFORE the |
320 | 320 | // lock is released so it's guaranteed to be deleted by the time we get the lock |
321 | | - indicesService.processPendingDeletes(index, indexSettings, new TimeValue(30, TimeUnit.MINUTES)); |
| 321 | + indicesService.processPendingDeletes(index, indexSettings, timeout); |
322 | 322 | } catch (ShardLockObtainFailedException exc) { |
323 | | - logger.warn("[{}] failed to lock all shards for index - timed out after 30 seconds", index); |
| 323 | + logger.warn("[{}] failed to lock all shards for index - timed out after [{}]]", index, timeout); |
324 | 324 | } catch (InterruptedException e) { |
325 | 325 | logger.warn("[{}] failed to lock all shards for index - interrupted", index); |
326 | 326 | } |
|
0 commit comments