You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ra...@apache.org on 2025/07/15 05:48:53 UTC

(atlas) 01/01: ATLAS-5070: Startup failure due to NPE in IndexRecoveryService when atlas.index.recovery.start.time is unset

This is an automated email from the ASF dual-hosted git repository.

radhikakundam pushed a commit to branch master-atlas-5070
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit a4176e8b896287159fdf59c5b23583105322cc76
Author: Radhika Kundam <ra...@gmail.com>
AuthorDate: Mon Jul 14 22:46:43 2025 -0700

    ATLAS-5070: Startup failure due to NPE in IndexRecoveryService when atlas.index.recovery.start.time is unset
---
 .../apache/atlas/repository/graph/IndexRecoveryService.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java b/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
index d59935511..277143336 100644
--- a/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
+++ b/repository/src/main/java/org/apache/atlas/repository/graph/IndexRecoveryService.java
@@ -28,6 +28,7 @@ import org.apache.atlas.repository.graphdb.AtlasGraphQuery;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.service.Service;
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -132,12 +133,13 @@ public class IndexRecoveryService implements Service, ActiveStateChangeHandler {
         long ret = 0L;
 
         try {
-            String           time       = config.getString(SOLR_INDEX_RECOVERY_CONFIGURED_START_TIME);
-            SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+            String time = config.getString(SOLR_INDEX_RECOVERY_CONFIGURED_START_TIME);
+            if (StringUtils.isNotBlank(time)) {
+                SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+                dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
 
-            dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
-
-            ret = dateFormat.parse(time).toInstant().toEpochMilli();
+                ret = dateFormat.parse(time).toInstant().toEpochMilli();
+            }
         } catch (Exception e) {
             LOG.error("Error fetching: {}", SOLR_INDEX_RECOVERY_CONFIGURED_START_TIME, e);
         }