You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2022/09/28 13:09:57 UTC
[accumulo] branch main updated: Fix NPE in suspend logging (#2970)
This is an automated email from the ASF dual-hosted git repository.
mmiller pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 1a3c7c1fc7 Fix NPE in suspend logging (#2970)
1a3c7c1fc7 is described below
commit 1a3c7c1fc75dcf665946d2d3dcbb36c52528f0f2
Author: Mike Miller <mm...@apache.org>
AuthorDate: Wed Sep 28 13:09:49 2022 +0000
Fix NPE in suspend logging (#2970)
---
.../accumulo/server/manager/state/LoggingTabletStateStore.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java
index 9b77eca49c..4a9fdb7845 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java
@@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.logging.TabletLogger;
import org.apache.accumulo.core.metadata.TServerInstance;
import org.apache.accumulo.core.metadata.TabletLocationState;
+import org.apache.accumulo.core.util.HostAndPort;
import org.apache.hadoop.fs.Path;
/**
@@ -85,8 +86,13 @@ class LoggingTabletStateStore implements TabletStateStore {
logsForDeadServers = Map.of();
for (TabletLocationState tls : tablets) {
- TabletLogger.suspended(tls.extent, tls.current.getHostAndPort(), suspensionTimestamp,
- TimeUnit.MILLISECONDS, logsForDeadServers.size());
+ var location = tls.getLocation();
+ HostAndPort server = null;
+ if (location != null) {
+ server = location.getHostAndPort();
+ }
+ TabletLogger.suspended(tls.extent, server, suspensionTimestamp, TimeUnit.MILLISECONDS,
+ logsForDeadServers.size());
}
}