B
bugbear
In a shell-out I'm having a problem.
Having done far too much reading, I have separate
threads reading stdout, stderr, and a timeout thread
ensuring that my shell out doesn't take too long.
(I'm using external code for some batch processing).
If the process takes too long, the timeout
thread hits proc.destroy() on the "main" thread.
This works well.
I recently discovered that a "batch" process I was
using is itself a wrapper script (call it "parent")
that calls the "real code" (call it "infinite")
The real code, as you may have guessed, went
infinite.
My timeout code killed the "parent" thread, and
then my 2 stdout/stderr emptying threads ... waited.
Sadly, the infinite process does *NOT* die, and since
it inherited stdout and stderr from its parent, my emptyer
threads don't terminate. Bizarrely, the infinite process
then had a parent process Id of 1.
My speculation is that Java is using a kill(2) system call.
http://linux.ctyme.com/man/man1333.htm
Sadly, I suspect that Java is using the positive pid
entry point, whereas I suspect it should be sending
in the negative pid.
Has anyone else seen this, know a cure or workround?
BugBear
Having done far too much reading, I have separate
threads reading stdout, stderr, and a timeout thread
ensuring that my shell out doesn't take too long.
(I'm using external code for some batch processing).
If the process takes too long, the timeout
thread hits proc.destroy() on the "main" thread.
This works well.
I recently discovered that a "batch" process I was
using is itself a wrapper script (call it "parent")
that calls the "real code" (call it "infinite")
The real code, as you may have guessed, went
infinite.
My timeout code killed the "parent" thread, and
then my 2 stdout/stderr emptying threads ... waited.
Sadly, the infinite process does *NOT* die, and since
it inherited stdout and stderr from its parent, my emptyer
threads don't terminate. Bizarrely, the infinite process
then had a parent process Id of 1.
My speculation is that Java is using a kill(2) system call.
http://linux.ctyme.com/man/man1333.htm
Sadly, I suspect that Java is using the positive pid
entry point, whereas I suspect it should be sending
in the negative pid.
Has anyone else seen this, know a cure or workround?
BugBear