You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2020/04/07 07:58:32 UTC
[maven-surefire] 03/03: don't print ClosedChannelException in dump
file on exit
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch maven2surefire-jvm-communication
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit ea0613478713dc673765413e2dd357be05652571
Author: tibordigana <ti...@apache.org>
AuthorDate: Tue Apr 7 09:58:07 2020 +0200
don't print ClosedChannelException in dump file on exit
---
.../surefire/booter/spi/LegacyMasterProcessChannelEncoder.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/spi/LegacyMasterProcessChannelEncoder.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/spi/LegacyMasterProcessChannelEncoder.java
index 91d9d1b..209790d 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/spi/LegacyMasterProcessChannelEncoder.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/spi/LegacyMasterProcessChannelEncoder.java
@@ -83,6 +83,7 @@ public class LegacyMasterProcessChannelEncoder implements MasterProcessChannelEn
private final WritableBufferedByteChannel out;
private final RunMode runMode;
private final AtomicBoolean trouble = new AtomicBoolean();
+ private volatile boolean onExit;
public LegacyMasterProcessChannelEncoder( @Nonnull WritableBufferedByteChannel out )
{
@@ -116,6 +117,7 @@ public class LegacyMasterProcessChannelEncoder implements MasterProcessChannelEn
@Override
public void onJvmExit()
{
+ onExit = true;
encodeAndPrintEvent( new StringBuilder( "\n" ), true );
}
@@ -318,8 +320,11 @@ public class LegacyMasterProcessChannelEncoder implements MasterProcessChannelEn
}
catch ( ClosedChannelException e )
{
- DumpErrorSingleton.getSingleton()
- .dumpException( e, "Channel closed while writing the event '" + event + "'." );
+ if ( !onExit )
+ {
+ DumpErrorSingleton.getSingleton()
+ .dumpException( e, "Channel closed while writing the event '" + event + "'." );
+ }
}
catch ( IOException e )
{