You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@continuum.apache.org by John Didion <Jo...@loudeye.com> on 2006/04/12 04:31:17 UTC

Continuum hangs when building a Maven project that spawns a process

We have a project that spawns a process (via Runtime.exec) that is
intended to live beyond the duration of the build. When Continuum builds
this project, the status is always "in progress". 

 

The problem seems to be that the stream pumper that redirects the output
from maven hangs on in.readLine(), where in is a reader that wraps the
maven process' input stream. Apparently, the process' input stream never
closes (even though the jvm running maven exits after the build
completes) and the input stream's read method is blocking. If I manually
kill the process spawned by maven, then the input stream closes and the
build completes. 

 

The interesting this is that if I write a simple java class to invoke
maven via Runtime.exec (in the same manner that continuum does via
plexus' Commandline class) and then call this from the command line,
everything works fine. We were also doing this exact same thing in an
ant build.xml via CruiseControl, and it worked fine. 

 

My hunch is that it has something to do with the wrapper program that is
used to invoke continuum.

 

Continuum's process chain looks like this: wrapper->continuum
jvm->maven->longrunningprocess

CruiseControl's process chain looks like this: cruise control jvm->build
loop thread->ant->longrunningprocess

 

Does anyone have any idea why this would be, and, more importantly, how
I can work around it?


Re: Continuum hangs when building a Maven project that spawns a process

Posted by Emmanuel Venisse <em...@venisse.net>.
John Didion a écrit :
> We have a project that spawns a process (via Runtime.exec) that is
> intended to live beyond the duration of the build. When Continuum builds
> this project, the status is always "in progress". 

Why do you have this? If the project live beyond the duration of the build, it isn't a test so it 
mustn't run in a continuum build.

> 
>  
> 
> The problem seems to be that the stream pumper that redirects the output
> from maven hangs on in.readLine(), where in is a reader that wraps the
> maven process' input stream. Apparently, the process' input stream never
> closes (even though the jvm running maven exits after the build
> completes) and the input stream's read method is blocking. If I manually
> kill the process spawned by maven, then the input stream closes and the
> build completes. 

What is your OS?
> 
>  
> 
> The interesting this is that if I write a simple java class to invoke
> maven via Runtime.exec (in the same manner that continuum does via
> plexus' Commandline class) and then call this from the command line,
> everything works fine. We were also doing this exact same thing in an
> ant build.xml via CruiseControl, and it worked fine. 

Can you send us your simple java class? Do you think it's a bug in continuum code?

> 
>  
> 
> My hunch is that it has something to do with the wrapper program that is
> used to invoke continuum.
> 
>  
> 
> Continuum's process chain looks like this: wrapper->continuum
> jvm->maven->longrunningprocess
> 
> CruiseControl's process chain looks like this: cruise control jvm->build
> loop thread->ant->longrunningprocess
> 
>  
> 
> Does anyone have any idea why this would be, and, more importantly, how
> I can work around it?
> 
>