You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bigtop.apache.org by Jay Vyas <ja...@gmail.com> on 2013/08/29 03:30:57 UTC

ITest Shell.groovy hangs

Hi bigtop ! Im finding that a complex shell script, run via Shell.groovy,
hangs when i call it.

Ive foud that the script fails after "PROCES :::::::: READ LINES" below, in
the debugging statement.

This is a shell script which starts a flume sink up using nohup, and then
cat's to a file that the sink is listening on.   The script completes
normally when run from anywhere in the terminal.

Any thoughts on why the ITest Shell would hang ?

***************************


    Thread.start {
      def writer = new PrintWriter(new BufferedOutputStream(proc.out))
      writer.println(script)
      writer.close()
    }
    ByteArrayOutputStream baosErr = new ByteArrayOutputStream(4096);
    proc.consumeProcessErrorStream(baosErr);
    println(key+" PROCESS :::::: READ LINES")
    out = proc.in.readLines()

    // Possibly a bug in String.split as it generates a 1-element array on
an
    // empty String
    if (baosErr.size() != 0) {
      err = baosErr.toString().split('\n');
    }
    else {
      err = new ArrayList<String>();
    }
    println(key+" PROCESS::::::: wait for ")


-- 
Jay Vyas
http://jayunit100.blogspot.com

Re: ITest Shell.groovy hangs

Posted by Roman Shaposhnik <ro...@shaposhnik.org>.
On Thu, Aug 29, 2013 at 1:32 PM, Jay Vyas <ja...@gmail.com> wrote:
> Thanks roman.  What is this patch doing ? how is it more defensive then the
> existing one?

Its not really for anything in particular just to give you ideas of what may
help debug the issue. I have a hunch your issue may be *somehow*
related to IO blocking on buffer size, but I'm not sure.

Thanks,
Roman.

Re: ITest Shell.groovy hangs

Posted by Jay Vyas <ja...@gmail.com>.
Thanks roman.  What is this patch doing ? how is it more defensive then the
existing one?


On Thu, Aug 29, 2013 at 1:07 PM, Roman Shaposhnik <rv...@apache.org> wrote:

> On Wed, Aug 28, 2013 at 6:30 PM, Jay Vyas <ja...@gmail.com> wrote:
> > Hi bigtop ! Im finding that a complex shell script, run via Shell.groovy,
> > hangs when i call it.
> >
> > Ive foud that the script fails after "PROCES :::::::: READ LINES" below,
> in
> > the debugging statement.
> >
> > This is a shell script which starts a flume sink up using nohup, and then
> > cat's to a file that the sink is listening on.   The script completes
> > normally when run from anywhere in the terminal.
>
> Could you possibly attach a script?
>
> > Any thoughts on why the ITest Shell would hang ?
>
> I'm surprised it fails that way, since there's quite a big of existing
> scripts
> that get pumped through it. To get you unstuck, though, you can
> try to do what I've done in the attached diff and see if that makes
> any difference.
>
> Thanks,
> Roman.
>



-- 
Jay Vyas
http://jayunit100.blogspot.com

Re: ITest Shell.groovy hangs

Posted by Roman Shaposhnik <rv...@apache.org>.
On Wed, Aug 28, 2013 at 6:30 PM, Jay Vyas <ja...@gmail.com> wrote:
> Hi bigtop ! Im finding that a complex shell script, run via Shell.groovy,
> hangs when i call it.
>
> Ive foud that the script fails after "PROCES :::::::: READ LINES" below, in
> the debugging statement.
>
> This is a shell script which starts a flume sink up using nohup, and then
> cat's to a file that the sink is listening on.   The script completes
> normally when run from anywhere in the terminal.

Could you possibly attach a script?

> Any thoughts on why the ITest Shell would hang ?

I'm surprised it fails that way, since there's quite a big of existing scripts
that get pumped through it. To get you unstuck, though, you can
try to do what I've done in the attached diff and see if that makes
any difference.

Thanks,
Roman.