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

Poor exception propagation in Shell#setInstance()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.3, 1.8.0
    • Component/s: test
    • Labels:
      None

      Description

      experimentalPropTest(org.apache.accumulo.test.ShellConfigIT)  Time elapsed: 63.119 sec  <<< ERROR!
      java.lang.IllegalArgumentException: Unable to load client config from /etc/accumulo/conf/client.conf
        at org.apache.accumulo.fate.zookeeper.ZooSession.connect(ZooSession.java:124)
        at org.apache.accumulo.fate.zookeeper.ZooSession.getSession(ZooSession.java:164)
        at org.apache.accumulo.fate.zookeeper.ZooReader.getSession(ZooReader.java:43)
        at org.apache.accumulo.fate.zookeeper.ZooReader.getZooKeeper(ZooReader.java:47)
        at org.apache.accumulo.fate.zookeeper.ZooCache.getZooKeeper(ZooCache.java:59)
        at org.apache.accumulo.fate.zookeeper.ZooCache.retry(ZooCache.java:159)
        at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:289)
        at org.apache.accumulo.fate.zookeeper.ZooCache.get(ZooCache.java:238)
        at org.apache.accumulo.core.client.ZooKeeperInstance.getInstanceID(ZooKeeperInstance.java:169)
        at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:159)
        at org.apache.accumulo.core.client.ZooKeeperInstance.<init>(ZooKeeperInstance.java:140)
        at org.apache.accumulo.shell.Shell.getZooInstance(Shell.java:498)
        at org.apache.accumulo.shell.Shell.setInstance(Shell.java:452)
        at org.apache.accumulo.shell.Shell.config(Shell.java:306)
        at org.apache.accumulo.test.ShellServerIT$TestShell.<init>(ShellServerIT.java:162)
        at org.apache.accumulo.test.ShellConfigIT.experimentalPropTest(ShellConfigIT.java:90)
      

      This test failed, appearing to state that the test failed because it could not load the client configuration file. However, if you actually inspect the stack trace, it points to the following code:

            if (System.currentTimeMillis() - startTime > 2 * timeout) {
              throw new RuntimeException("Failed to connect to zookeeper (" + host + ") within 2x zookeeper timeout period " + timeout);
            }
      

      In fact, the test failed because it failed to connect to the zookeeper server with 2x the ZK session timeout. We should improve this try/catch so that it's actually realistically telling the user what went wrong.

        Attachments

          Activity

            People

            • Assignee:
              elserj Josh Elser
              Reporter:
              elserj Josh Elser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h