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 9267D10F58 for ; Sun, 30 Nov 2014 03:36:34 +0000 (UTC) Received: (qmail 95020 invoked by uid 500); 30 Nov 2014 03:36:29 -0000 Delivered-To: apmail-accumulo-user-archive@accumulo.apache.org Received: (qmail 94962 invoked by uid 500); 30 Nov 2014 03:36:28 -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 94948 invoked by uid 99); 30 Nov 2014 03:36:28 -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 03:36:28 +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 josh.elser@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qa0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Nov 2014 03:36:02 +0000 Received: by mail-qa0-f43.google.com with SMTP id bm13so5881281qab.16 for ; Sat, 29 Nov 2014 19:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=fLfl1JbDAYrvz4m5ofI+GD30BbMuZtYMfQCwa2fsINE=; b=xTWHGchEPnz6GsKERidJyVSwE09T/5IwBcjsdRRYLDUv/FP3iU2zhieKgOGgFKzlbS +bWcmfYv9/wyrRfGAPtJw5asLZaw0uRNj15kSf+0a3F9Y95unpHUj9ICQEGy8BZwrUFJ 7TEx+Ol+tL0RHIxLXqOm9Nf+Twcl2dClLpL52LTNgZ+xDbULkXn6TvsRrsXfb7DzXpkt R60HYCrqG76/b3UsIkticvadKyT00jGUMJyXtjf/FL4Pmgk9zRWfwyHJsAmm1g1AEJzP HGQwZMYvaz6JXxDVhb3JsBE0z4DY9wQ7NfBH/Pr/zDn8IWwaW915eGJVPUtKV77Xux+8 SIYg== X-Received: by 10.140.101.141 with SMTP id u13mr24388773qge.48.1417318516728; Sat, 29 Nov 2014 19:35:16 -0800 (PST) Received: from [192.168.254.15] (h142.183.123.208.dynamic.ip.windstream.net. [208.123.183.142]) by mx.google.com with ESMTPSA id w15sm13727583qaw.12.2014.11.29.19.35.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 29 Nov 2014 19:35:16 -0800 (PST) Message-ID: <547A9071.1020704@gmail.com> Date: Sat, 29 Nov 2014 22:35:13 -0500 From: Josh Elser User-Agent: Postbox 3.0.11 (Macintosh/20140602) MIME-Version: 1.0 To: user@accumulo.apache.org Subject: Re: Program runs fine in NetBeans fails the shutdown properly running via Maven References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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?