|
9 | 9 |
|
10 | 10 | package org.elasticsearch.ingest.geoip; |
11 | 11 |
|
| 12 | +import org.apache.logging.log4j.Level; |
12 | 13 | import org.apache.logging.log4j.LogManager; |
13 | 14 | import org.apache.logging.log4j.Logger; |
14 | 15 | import org.elasticsearch.action.ActionListener; |
|
24 | 25 | import org.elasticsearch.common.settings.Setting; |
25 | 26 | import org.elasticsearch.common.settings.Setting.Property; |
26 | 27 | import org.elasticsearch.common.settings.Settings; |
| 28 | +import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; |
27 | 29 | import org.elasticsearch.core.TimeValue; |
28 | 30 | import org.elasticsearch.core.Tuple; |
29 | 31 | import org.elasticsearch.index.query.BoolQueryBuilder; |
|
33 | 35 | import org.elasticsearch.index.reindex.DeleteByQueryRequest; |
34 | 36 | import org.elasticsearch.ingest.geoip.GeoIpTaskState.Metadata; |
35 | 37 | import org.elasticsearch.ingest.geoip.stats.GeoIpDownloaderStats; |
| 38 | +import org.elasticsearch.node.NodeClosedException; |
36 | 39 | import org.elasticsearch.persistent.PersistentTasksCustomMetadata.PersistentTask; |
37 | 40 | import org.elasticsearch.tasks.TaskId; |
38 | 41 | import org.elasticsearch.threadpool.ThreadPool; |
@@ -209,7 +212,13 @@ private void processDatabase(final String name, final String md5, final String u |
209 | 212 | } |
210 | 213 | } catch (Exception e) { |
211 | 214 | stats = stats.failedDownload(); |
212 | | - logger.error(() -> "error downloading geoip database [" + name + "] for project [" + projectId + "]", e); |
| 215 | + boolean nodeShuttingDown = e instanceof NodeClosedException |
| 216 | + || (e instanceof EsRejectedExecutionException rejected && rejected.isExecutorShutdown()); |
| 217 | + logger.log( |
| 218 | + nodeShuttingDown ? Level.INFO : Level.ERROR, |
| 219 | + () -> "error downloading geoip database [" + name + "] for project [" + projectId + "]", |
| 220 | + e |
| 221 | + ); |
213 | 222 | } |
214 | 223 | } |
215 | 224 |
|
|
0 commit comments