Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED42E10B5F for ; Tue, 25 Feb 2014 06:57:29 +0000 (UTC) Received: (qmail 88215 invoked by uid 500); 25 Feb 2014 06:57:29 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 87525 invoked by uid 500); 25 Feb 2014 06:57:21 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 87480 invoked by uid 99); 25 Feb 2014 06:57:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Feb 2014 06:57:19 +0000 Date: Tue, 25 Feb 2014 06:57:19 +0000 (UTC) From: "Vikram Srivastava (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-2400) race condition in ExamplesIT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ACCUMULO-2400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13911326#comment-13911326 ] Vikram Srivastava commented on ACCUMULO-2400: --------------------------------------------- [~kturner] exec already does the logging using {{LogWriter}} : {noformat} Process process = builder.start(); LogWriter lw; lw = new LogWriter(process.getErrorStream(), new File(config.getLogDir(), clazz.getSimpleName() + "_" + process.hashCode() + ".err")); logWriters.add(lw); lw.start(); lw = new LogWriter(process.getInputStream(), new File(config.getLogDir(), clazz.getSimpleName() + "_" + process.hashCode() + ".out")); logWriters.add(lw); lw.start(); {noformat} Are you looking for something more? (BTW, the log file names can be improved) > race condition in ExamplesIT > ---------------------------- > > Key: ACCUMULO-2400 > URL: https://issues.apache.org/jira/browse/ACCUMULO-2400 > Project: Accumulo > Issue Type: Bug > Environment: 6395840418046d8b3a923a4bfb3e4ba486c5dcd0 > Reporter: Keith Turner > Fix For: 1.6.0 > > > Saw ExamplesIT fail with the following exception. Looking at the code I think there is a race condition. The test calls the MAC.exec() function to create a process and then reads from stdout of the process. The MAC exec function starts a background thread to read from stdout. If this background thread reads stdout before the test I think it will fail in the following way. Probably need to fix everywhere MAC exec is used in this way. Could either read from the file MAC creates or pass an option to MAC.exec() to not start the background thread. > {noformat} > java.io.IOException: Stream closed > at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162) > at java.io.BufferedInputStream.read(BufferedInputStream.java:325) > at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) > at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) > at java.io.InputStreamReader.read(InputStreamReader.java:184) > at java.io.BufferedReader.fill(BufferedReader.java:154) > at java.io.BufferedReader.readLine(BufferedReader.java:317) > at java.io.BufferedReader.readLine(BufferedReader.java:382) > at org.apache.accumulo.test.functional.ExamplesIT.testClasspath(ExamplesIT.java:172) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) > at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) > at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) > {noformat} -- This message was sent by Atlassian JIRA (v6.1.5#6160)