Return-Path: X-Original-To: apmail-accumulo-user-archive@www.apache.org Delivered-To: apmail-accumulo-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73584C8CD for ; Sun, 30 Nov 2014 14:10:50 +0000 (UTC) Received: (qmail 55275 invoked by uid 500); 30 Nov 2014 14:10:50 -0000 Delivered-To: apmail-accumulo-user-archive@accumulo.apache.org Received: (qmail 55226 invoked by uid 500); 30 Nov 2014 14:10:50 -0000 Mailing-List: contact user-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@accumulo.apache.org Delivered-To: mailing list user@accumulo.apache.org Received: (qmail 55216 invoked by uid 99); 30 Nov 2014 14:10:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Nov 2014 14:10:50 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of david.medinets@gmail.com designates 209.85.212.174 as permitted sender) Received: from [209.85.212.174] (HELO mail-wi0-f174.google.com) (209.85.212.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Nov 2014 14:10:24 +0000 Received: by mail-wi0-f174.google.com with SMTP id h11so22188711wiw.13 for ; Sun, 30 Nov 2014 06:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=aL6gO5c6SjGZds5TY8v+2tSpVN+euYkIbyQjCT0/dec=; b=Kbau8KAgJZe0B1thFZLrzX2LO6mwcxSTWYBUyTS8QcFFEczJ6G/Fdx6VGcYl5NQxwW dlxunJFfMROP0TsY5/DtlbFEH63waLdor/G9PJEAk9dn3i4Ar+cInPDZJgcjl7WbmDBC hw97eLRTG1bdASkJirI2RqEIAP2xIaB1+MPJ6vtO4lc4NRMSN5ArWcJzEbcWlbeB8zEu 4e9PdC5TtRHska5IQKWaJnJiF7zMlHEP+wCNCfIZOQibPSFXG7YnRxDO5CbVoQbEAQP0 J2NQZCTjQ0Mtffc+gbKJE+OA1KADP4WgiyXZgV6qZav1Bg7B1EogBRdQmp+18jOFUiP1 1MMw== MIME-Version: 1.0 X-Received: by 10.180.182.226 with SMTP id eh2mr77847034wic.9.1417356624026; Sun, 30 Nov 2014 06:10:24 -0800 (PST) Received: by 10.194.13.65 with HTTP; Sun, 30 Nov 2014 06:10:23 -0800 (PST) In-Reply-To: <547AA5B7.9010902@gmail.com> References: <547A9071.1020704@gmail.com> <547AA5B7.9010902@gmail.com> Date: Sun, 30 Nov 2014 09:10:23 -0500 Message-ID: Subject: Re: Program runs fine in NetBeans fails the shutdown properly running via Maven From: David Medinets To: accumulo-user Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Right again. I changed the package name to "jaredwinick" and the "sealing violation" issue was resolved. But the JIRA ticket comments were correct about the code's being brittle. It has a String literal that refers to "org.apache.accumulo.core.zookeeper.ZooSession"which does not exist in Accumulo v1.6.1. On Sun, Nov 30, 2014 at 12:05 AM, Josh Elser wrote: > I believe that means you re-used the package org.apache.accumulo.core.util > which was already defined in accumulo-core.jar. > > Don't do that. > > > David Medinets wrote: >> >> Thanks Josh. That explanation makes sense. I added the referenced >> ClientThreads.shutdownNow() method to my code and ran into the >> following: >> >> java.lang.SecurityException: sealing violation: package >> org.apache.accumulo.core.util is sealed >> >> >> I can live with this issue until v2.0 since it happens when the JVM is >> exiting. And I'm just writing demonstration code for no particular >> reason. At the least, we'll have a small project to test the fix >> against. >> >> >> On Sat, Nov 29, 2014 at 10:35 PM, Josh Elser wrote: >>> >>> From http://mojo.codehaus.org/exec-maven-plugin/usage.html, >>> >>> "By default daemon threads are joined and interrupted once all known non >>> daemon threads have quitted" >>> >>> So, your main thread finished, but before the exec plugin stopped the >>> application, it tried to interrupt the other non-daemon threads that were >>> still running (which should be a sign for them quit on their own). >>> >>> However, it's a known issue[1] that we have ZooKeeper and Thrift >>> resources >>> that are not cleaned up (a problem which is slated to be fixed by >>> Christopher's 2.0 API refactoring). >>> >>> Hope that makes sense. >>> >>> [1] https://issues.apache.org/jira/browse/ACCUMULO-2113 >>> >>> >>> David Medinets wrote: >>>> >>>> This might be a stupid David issue but it's at least marginally >>>> related to Accumulo so I'm hoping someone will recognize the problem >>>> and help. >>>> >>>> I am seeing this error when my program is run via maven: >>>> >>>> java.lang.InterruptedException: sleep interrupted >>>> >>>> The program connects to a MiniAccumuloCluster and creates a table if >>>> it does not exist. The program works fine inside Netbeans. >>>> >>>> In both NetBeans and Maven, the program connects to the >>>> MiniAccumuloCluster just fine. The shutdown is the problem. >>>> >>>> I have a github project which should demonstrate the issue. >>>> >>>> # First clone the project >>>> git clone https://github.com/medined/jodoc.git >>>> cd jodoc >>>> >>>> # Then build the java image >>>> cd java_zulu7 >>>> ./build_image.sh >>>> >>>> # Then compile and create a jar file >>>> mvn package >>>> >>>> # Then build the jodoc image >>>> ./build_image.sh >>>> >>>> # And run the jodoc image. This image runs a MiniAccumuloCluster >>>> # using port 20000 for Zookeeper. >>>> ./run_image.sh >>>> >>>> # Finally run the client program via Maven >>>> mvn exec:java -Dexec.mainClass="com.codebits.jodoc.WriteAndReadDriver" >>>> -DZOOKEEPER_PORT=20000 >>>> >>>> Here is the full error stack: >>>> >>>> java.lang.InterruptedException: sleep interrupted >>>> at java.lang.Thread.sleep(Native Method) >>>> at >>>> >>>> org.apache.accumulo.core.client.impl.ThriftTransportPool$Closer.closeConnections(ThriftTransportPool.java:137) >>>> at >>>> >>>> org.apache.accumulo.core.client.impl.ThriftTransportPool$Closer.run(ThriftTransportPool.java:147) >>>> at java.lang.Thread.run(Thread.java:745) >>>> 2014-11-29 21:05:18,011 ERROR >>>> [com.codebits.jodoc.WriteAndReadDriver.main()-EventThread] >>>> zookeeper.ClientCnxn (ClientCnxn.java:run(513)) - Event thread exiting >>>> due to interruption >>>> java.lang.InterruptedException >>>> at >>>> >>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014) >>>> at >>>> >>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2048) >>>> at >>>> >>>> java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) >>>> at >>>> org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498) >>>> 2014-11-29 21:05:18,012 INFO >>>> [com.codebits.jodoc.WriteAndReadDriver.main()-EventThread] >>>> zookeeper.ClientCnxn (ClientCnxn.java:run(516)) - EventThread shut >>>> down >>>> 2014-11-29 21:05:28,010 WARN >>>> [com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000)] >>>> zookeeper.ClientCnxn (ClientCnxn.java:run(1185)) - Session >>>> 0x149fe6a2c5a0007 for server localhost/127.0.0.1:20000, unexpected >>>> error, closing socket connection and attempting reconnect >>>> java.nio.channels.ClosedByInterruptException >>>> at >>>> >>>> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202) >>>> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:477) >>>> at >>>> org.apache.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:890) >>>> at >>>> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1154) >>>> 2014-11-29 21:05:29,596 INFO >>>> [com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000)] >>>> zookeeper.ClientCnxn (ClientCnxn.java:startConnect(1058)) - Opening >>>> socket connection to server localhost/127.0.0.1:20000 >>>> 2014-11-29 21:05:29,596 INFO >>>> [com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000)] >>>> zookeeper.ClientCnxn (ClientCnxn.java:primeConnection(947)) - Socket >>>> connection established to localhost/127.0.0.1:20000, initiating >>>> session >>>> 2014-11-29 21:05:29,598 INFO >>>> [com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000)] >>>> zookeeper.ClientCnxn (ClientCnxn.java:readConnectResult(736)) - >>>> Session establishment complete on server localhost/127.0.0.1:20000, >>>> sessionid = 0x149fe6a2c5a0007, negotiated timeout = 30000 >>>> [WARNING] thread >>>> >>>> >>>> Thread[com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000),5,com.codebits.jodoc.WriteAndReadDriver] >>>> was interrupted but is still alive after waiting at least 15000msecs >>>> [WARNING] thread >>>> >>>> >>>> Thread[com.codebits.jodoc.WriteAndReadDriver.main(localhost:20000),5,com.codebits.jodoc.WriteAndReadDriver] >>>> will linger despite being asked to die via interruption >>>> [WARNING] thread Thread[Thrift Connection Pool >>>> Checker,5,com.codebits.jodoc.WriteAndReadDriver] will linger despite >>>> being asked to die via interruption >>>> [WARNING] NOTE: 2 thread(s) did not finish despite being asked to via >>>> interruption. This is not a problem with exec:java, it is a problem >>>> with the running code. Although not serious, it should be remedied. >>>> [WARNING] Couldn't destroy threadgroup >>>> >>>> >>>> org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=com.codebits.jodoc.WriteAndReadDriver,maxpri=10] >>>> java.lang.IllegalThreadStateException >>>> at java.lang.ThreadGroup.destroy(ThreadGroup.java:778) >>>> at >>>> org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:328) >>>> at >>>> >>>> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) >>>> at >>>> >>>> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) >>>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) >>>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) >>>> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) >>>> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) >>>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >>>> at >>>> >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:483) >>>> at >>>> >>>> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) >>>> at >>>> >>>> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) >>>> at >>>> >>>> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) >>>> at >>>> >>>> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) >>>> >>>> ---- >>>> >>>> Any ideas?