Giter VIP home page Giter VIP logo

Comments (5)

reinra avatar reinra commented on August 15, 2024

Thanks for reporting this. I pushed a fix.
You can try it if you build the latest code on your machine.
I'm probably going to release 1.9 also soon.

from zt-exec.

nwolfe avatar nwolfe commented on August 15, 2024

@reinra Thank you for the quick reply! I've learned some things in the meantime.

We just determined that this is some kind of race condition, as opposed to a 100%-reproducible bug. If you use a script like this:

#!/usr/bin/env sh

exit 0

instead of calling /bin/true directly, the exception seems to be thrown significantly less frequently. This leads me to believe that some of the overhead of running the env command and starting another sh in the script above causes some background processing in the JDK to be more likely to have completed before the process exits, and somehow this prevents the exception from being triggered.

from zt-exec.

reinra avatar reinra commented on August 15, 2024

It makes sense as this error only occurred if JVM couldn't flush the buffer to forked process' stdin before the process was closed. If the process runs longer there's enough time to write into the stdin.

from zt-exec.

AlexanderMakarov avatar AlexanderMakarov commented on August 15, 2024

Seems like issue wrongly closed.
Because there are no ability to communicate with process STDIN. Original OutputStream is closed here. ProcessExecutor want to work only with PumpStreamHandler, looks like interface ExecuteStreamHandler useless in streams(ExecuteStreamHandler). Moreover PumpStreamHandler recreated by ProcessExecutor few times basing on streams from previous PumpStreamHandler.

Helps only custom inheritor of PumpStreamHandler with executing ProcessExecutor without readOutput, redirectOutput, etc. and with streams(customHandler). But in this case library profit goes to zero.

from zt-exec.

AlexanderMakarov avatar AlexanderMakarov commented on August 15, 2024

communicate

I mean exactly "communication", i.e. read process STDOUT and write into its STDIN continuously.

from zt-exec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.