[ 
https://issues.apache.org/jira/browse/LUCENE-6530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14576673#comment-14576673
 ] 

Dawid Weiss commented on LUCENE-6530:
-------------------------------------

Well, it can't be an output stream because then you could redirect 
within-process (to a byte array, for example). The Redirect.to(File) works by 
passing raw file descriptors (both in unix and in Windows) to a subprocess when 
it is forked (UNIXProcess_md.c makes an interesting reading, but all of 
ProcessBuilder is interesting, especially comments...).
{quote}
            case SOLARIS:
                // There is a risk that pid will be recycled, causing us to
                // kill the wrong process!  So we only terminate processes
                // that appear to still be running.  Even with this check,
                // there is an unavoidable race condition here, but the window
                // is very small, and OSes try hard to not recycle pids too
                // soon, so this is quite safe.
{quote}

I never found process builder to be quite what I needed, to be honest. For 
example shell escaping never worked for me too well.

> Use Java 7 ProcessBuilder.inheritIO() instead of own ThreadPumper
> -----------------------------------------------------------------
>
>                 Key: LUCENE-6530
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6530
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>            Priority: Minor
>              Labels: Java7
>             Fix For: Trunk, 5.3
>
>         Attachments: LUCENE-6530.patch, LUCENE-6530.patch
>
>
> In some tests wie spawn separate processes (TestIndexWriterOnJRECrash and 
> Solr's IPTables). To capture stdin/stdout/stderr we spawn several threads 
> that pump those to stdout/stderr.
> Since Java 7 there is ProcessBuilder.inheritIO() that does this for us 
> without any additional threads. We should use this instead. Fix is easy, just 
> remove some stuff :-)
> I did the same already for my Codec classloader deadlock test, so this is 
> just a followup for the other tests.
> Patch is attached and can be committed to trunk and 5.x.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to