Currently Jenkins build fails on OOM not because of I/O streams but because
of missing this code

ThreadedStreamConsumer which was introduced by Kristian Roselvold with
a purpose.

Now we can do it better using LinkedBlockingQueue put()/take().


public void consumeLine( String s )
    {
        items.add( s );
        if ( items.size() > ITEM_LIMIT_BEFORE_SLEEP )
        {
            try
            {
                Thread.sleep( 100 );
            }
            catch ( InterruptedException ignore )
            {
            }
        }
    }

On Sun, Jan 8, 2017 at 3:48 AM, Christian Schulte <c...@schulte.it> wrote:

> Am 01/08/17 um 03:28 schrieb Tibor Digana:
> > As an example flush() is missing in RunEntryStatisticsMap.java L130.
> > Maybe I would find more but this is not the only case. There are 24 files
> > changed.
>
> It's not missing there. Close is guaranteed to perform a flush implicitly.
>
> resource.flush();
> resource.close();
>
> The flush really is not needed. If removing a call to the flush method
> introduces an issue, the real issue really is a missing call to close.
> There seems to be one case for which an IT is failing now. The IT is
> forcing an OutOfMemoryError and due to missing flush calls, some file is
> empty or not even created at all, because that error isn't handled
> correctly (there somewhere is a missing finally block to ensure open
> resources are cleaned up correctly). No flush -> OutOfMemoryError -> no
> call to close anywhere so no flushes performed.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


-- 
Cheers
Tibor

Reply via email to