Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3A239ADB for ; Fri, 10 Feb 2012 04:58:43 +0000 (UTC) Received: (qmail 93475 invoked by uid 500); 10 Feb 2012 04:58:41 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 93233 invoked by uid 500); 10 Feb 2012 04:58:26 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 93177 invoked by uid 99); 10 Feb 2012 04:58:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 04:58:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2012 04:58:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B22121ADB02 for ; Fri, 10 Feb 2012 04:57:59 +0000 (UTC) Date: Fri, 10 Feb 2012 04:57:59 +0000 (UTC) From: "Myrna van Lunteren (Commented) (JIRA)" To: derby-dev@db.apache.org Message-ID: <1392014536.23088.1328849879731.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1813363086.16163.1328731019564.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5608) BaseTestCase.readProcessOutput should read getInputStream() and getErrorStream() in separate threads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5608?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1320= 5228#comment-13205228 ]=20 Myrna van Lunteren commented on DERBY-5608: ------------------------------------------- I tried a run with a build with the patch applied on the system where the t= rouble is reproducible, and unfortunately, I see lots of cascading errors. It starts with this: 1) test_01_WrongUsage(org.apache.derbyTesting.functionTests.tests.derbynet.= NetworkServerControlApiTest)java.lang.InterruptedException =09at java.lang.ProcessImpl.waitFor(Native Method) =09at org.apache.derbyTesting.junit.SpawnedProcess.complete(SpawnedProcess.= java:214) =09at org.apache.derbyTesting.junit.SpawnedProcess.complete(SpawnedProcess.= java:176) =09at org.apache.derbyTesting.junit.BaseTestCase.readProcessOutput(BaseTest= Case.java:774) =09at org.apache.derbyTesting.junit.BaseTestCase.assertExecJavaCmdAsExpecte= d(BaseTestCase.java:508) =09at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerCon= trolApiTest.test_01_WrongUsage(NetworkServerControlApiTest.java:81) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:48) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:37) =09at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:= 113) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57= ) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) The next failure is=20 2) testBoundaries(org.apache.derbyTesting.functionTests.tests.jdbcapi.Inter= nationalConnectTest)java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQ= LSTATE: XJ001, SQLERRMC: java.security.AccessControlException=14Access deni= ed (java.io.FilePermission [edited path to system dir]\system\AAAAAAAAAAAAA= A[...repeat....]AAAA\tmp delete)=14XJ001.U =09 The third failure is: 3) shutdownDerby(org.apache.derbyTesting.functionTests.tests.store.BootAllT= est)java.lang.NullPointerException =09at org.apache.derby.impl.services.monitor.TopService.getService(TopServi= ce.java:128) =09at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(BaseMonit= or.java:199) =09at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:248) =09at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:= 143) =09at java.sql.DriverManager.getConnection(DriverManager.java:317) =09at java.sql.DriverManager.getConnection(DriverManager.java:297) =09at org.apache.derbyTesting.junit.DriverManagerConnector.getConnectionByA= ttributes(DriverManagerConnector.java:144) =09at org.apache.derbyTesting.junit.DriverManagerConnector.shutEngine(Drive= rManagerConnector.java:121) =09at org.apache.derbyTesting.junit.TestConfiguration.shutdownEngine(TestCo= nfiguration.java:1716) =09at org.apache.derbyTesting.functionTests.tests.store.BootAllTest.shutdow= nDerby(BootAllTest.java:116) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:48) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:37) =09at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:= 113) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:51= ) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:18) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:51= ) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:18) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:51= ) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:18) Which then leaves Derby system shutdown, and causes many, many more failure= s. Tests run: 11591, Failures: 76, Errors: 817 =20 > BaseTestCase.readProcessOutput should read getInputStream() and getError= Stream() in separate threads > -------------------------------------------------------------------------= ---------------------------- > > Key: DERBY-5608 > URL: https://issues.apache.org/jira/browse/DERBY-5608 > Project: Derby > Issue Type: Bug > Components: Test > Affects Versions: 10.9.0.0 > Reporter: Kathey Marsden > Assignee: Kristian Waagan > Priority: Minor > Attachments: derby-5608-1a-use_spawnedprocess.diff > > > BaseTestCase.readProcessOutput() reads the streams from Process.getInputS= tream() and Process.getErrorStream() sequentially=20 > InputStream is =3D pr.getInputStream(); > InputStream es =3D pr.getErrorStream(); > ... > output +=3D " " + inputStreamToString(is) + "\n"; > output +=3D "" + inputStreamToString(es) + "\n"; > I think that to be really correct the two streams need to be read in sep= arate threads because if the error output is large it could block and cau= se a hang if they are read sequentially like this. > I noticed during the DERBY-5601 discussion as Myrna referenced in that t= he addition of draining the error stream caused a different problem (an Int= erruptException). I don't understand how it could cause that problem but do= think a hang blocking on reading the input would be possible if the error= output was large enough both before and after the change to add the readi= ng of the error stream sequentially. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira