Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4556

Monitor shows stack trace for NPE while viewing table details for accumulo.root if tablet is offline

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1, 1.7.2, 1.8.0
    • Fix Version/s: 2.0.0
    • Component/s: monitor
    • Labels:

      Description

      AFAICT this is a problem in atleast 1.6.0 - current master (2.0-SNAPSHOT)

      Noticed this while debugging a cluster with offline root tablet:

      monitor -> Tables -> (shows accumulo.root with 1 offline tablet) -> accumulo.root ->

      java.lang.NullPointerException
      	at java.util.TreeMap.compare(TreeMap.java:1188)
      	at java.util.TreeMap.put(TreeMap.java:531)
      	at java.util.TreeSet.add(TreeSet.java:255)
      	at org.apache.accumulo.monitor.servlets.TablesServlet.doTableDetails(TablesServlet.java:152)
      	at org.apache.accumulo.monitor.servlets.TablesServlet.pageBody(TablesServlet.java:75)
      	at org.apache.accumulo.monitor.servlets.BasicServlet.doGet(BasicServlet.java:65)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:767)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      

      Looking at master branch our handling in TablesServlet looks like

        private void doTableDetails(HttpServletRequest req, StringBuilder sb, Map<String,String> tidToNameMap, String tableId) {
          String displayName = Tables.getPrintableTableNameFromId(tidToNameMap, tableId);
          Instance instance = Monitor.getContext().getInstance();
          TreeSet<String> locs = new TreeSet<>();
          if (RootTable.ID.equals(tableId)) {
            locs.add(instance.getRootTabletLocation());
          } else {
      ...
      

      The Instance API doesn't say it, but all of our current implementations return null for getRootTabletLocation when the root tablet is offline. Since we create locs with the empty constructor, it uses natural ordering and doesn't allow null members, so things explode.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                busbey Sean Busbey
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: