----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45099/#review128377 -----------------------------------------------------------
lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java (line 80) <https://reviews.apache.org/r/45099/#comment191815> I feel ealrier code of static registraion of shutdown hook is correct - https://github.com/apache/lens/blob/apache-lens-2.5.0-beta/lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java (line 127) <https://reviews.apache.org/r/45099/#comment191817> Hope this is used only in unit tests. Can we reduce the scope? Also, Commands should not take responsibility for closing these clients. what happens if we do the following : qcom.setclient(client1); qcom.setclient(client2); qcom.closeConnection() would only close client2. Instead we should leave closing of client1 and client2 to the creaters of them. - Amareshwari Sriramadasu On March 21, 2016, 11:47 a.m., Raju Bairishetti wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45099/ > ----------------------------------------------------------- > > (Updated March 21, 2016, 11:47 a.m.) > > > Review request for lens, Amareshwari Sriramadasu and Rajat Khandelwal. > > > Bugs: lens-991 > https://issues.apache.org/jira/browse/lens-991 > > > Repository: lens > > > Description > ------- > > Shutdown hook was getting called for each lens **command bean** whenver we do > ctrl+c on cli. > > > Diffs > ----- > > lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java > be1ca12 > src/site/apt/user/client-config.apt 714db18 > > Diff: https://reviews.apache.org/r/45099/diff/ > > > Testing > ------- > > **Before applying patch:** > > lens-shell>show cubes > No cube found > lens-shell>show params > ... > lens-shell>Exception in thread "Thread-3" java.lang.IllegalStateException: > Unable to close lens connection with params > LensConnectionParams{dbName='default', baseUrl='http://0.0.0.0:9999/lensapi', > user=anonymous, lensConfs={}, lensVars={}, sessionVars={}} > at org.apache.lens.client.LensConnection.close(LensConnection.java:206) > at > org.apache.lens.client.LensClient.closeConnection(LensClient.java:326) > at > org.apache.lens.cli.commands.BaseLensCommand.closeClientConnection(BaseLensCommand.java:92) > at > org.apache.lens.cli.commands.BaseLensCommand$2.run(BaseLensCommand.java:81) > LZDLocalAdmins-MacBook-Pro-2:client rajubairishetti$ > > > > **After aplying patch:** > > lens-shell>show cubes > No cube found > lens-shell>show params > ... > lens-shell>LZDLocalAdmins-MacBook-Pro-2:client rajubairishetti$ > > > Thanks, > > Raju Bairishetti > >
