You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by sebb <se...@gmail.com> on 2012/05/07 23:57:37 UTC

Re: svn commit: r1335274 - /jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java

On 7 May 2012 22:42,  <pm...@apache.org> wrote:
> Author: pmouawad
> Date: Mon May  7 21:42:42 2012
> New Revision: 1335274
>
> URL: http://svn.apache.org/viewvc?rev=1335274&view=rev
> Log:
> Bug 53136 - Catching Throwable needs to be carefully handled
>
> Modified:
>    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
>
> Modified: jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java?rev=1335274&r1=1335273&r2=1335274&view=diff
> ==============================================================================
> --- jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java (original)
> +++ jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java Mon May  7 21:42:42 2012
> @@ -23,6 +23,8 @@ import java.io.IOException;
>  import java.io.InputStream;
>  import java.io.InputStreamReader;
>
> +import org.apache.jorphan.util.JOrphanUtils;
> +
>  /**
>  * Thread that eats Output and Error Stream to avoid Deadlock on Windows Machines
>  * Inspired from:
> @@ -58,11 +60,7 @@ class StreamGobbler extends Thread {
>                {
>                        if(br != null)
>                        {
> -                               try {
> -                                       br.close();
> -                               } catch (Throwable e) {
> -                                       // NOOP
> -                               }
> +                           JOrphanUtils.closeQuietly(br);

Good catch, but the check for br != null is done by the closeQuietly method.

>                        }
>                }
>        }
>
>

Re: svn commit: r1335274 - /jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello sebb,
I fixed it in next commit.

Regards
Philippe

On Mon, May 7, 2012 at 11:57 PM, sebb <se...@gmail.com> wrote:

> On 7 May 2012 22:42,  <pm...@apache.org> wrote:
> > Author: pmouawad
> > Date: Mon May  7 21:42:42 2012
> > New Revision: 1335274
> >
> > URL: http://svn.apache.org/viewvc?rev=1335274&view=rev
> > Log:
> > Bug 53136 - Catching Throwable needs to be carefully handled
> >
> > Modified:
> >
>  jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
> >
> > Modified:
> jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
> > URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java?rev=1335274&r1=1335273&r2=1335274&view=diff
> >
> ==============================================================================
> > ---
> jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
> (original)
> > +++
> jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
> Mon May  7 21:42:42 2012
> > @@ -23,6 +23,8 @@ import java.io.IOException;
> >  import java.io.InputStream;
> >  import java.io.InputStreamReader;
> >
> > +import org.apache.jorphan.util.JOrphanUtils;
> > +
> >  /**
> >  * Thread that eats Output and Error Stream to avoid Deadlock on Windows
> Machines
> >  * Inspired from:
> > @@ -58,11 +60,7 @@ class StreamGobbler extends Thread {
> >                {
> >                        if(br != null)
> >                        {
> > -                               try {
> > -                                       br.close();
> > -                               } catch (Throwable e) {
> > -                                       // NOOP
> > -                               }
> > +                           JOrphanUtils.closeQuietly(br);
>
> Good catch, but the check for br != null is done by the closeQuietly
> method.
>
> >                        }
> >                }
> >        }
> >
> >
>



-- 
Cordialement.
Philippe Mouawad.