You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2017/06/04 22:39:04 UTC

[jira] [Commented] (SUREFIRE-1380) AbstractCommandStream should flush data if another Thread marks the stream closed, empty shared buffer.

    [ https://issues.apache.org/jira/browse/SUREFIRE-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16036414#comment-16036414 ] 

Hudson commented on SUREFIRE-1380:
----------------------------------

SUCCESS: Integrated in Jenkins build maven-surefire #1713 (See [https://builds.apache.org/job/maven-surefire/1713/])
[SUREFIRE-1380] AbstractCommandStream should flush data if another (tibor17: [http://git-wip-us.apache.org/repos/asf/?p=maven-surefire.git&a=commit&h=f1f3b6fab9e6179a9faa7537be49354fa58e7685])
* (edit) maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/AbstractCommandStream.java


> AbstractCommandStream should flush data if another Thread marks the stream closed, empty shared buffer.
> -------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1380
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1380
>             Project: Maven Surefire
>          Issue Type: Task
>          Components: Maven Failsafe Plugin, Maven Surefire Plugin
>            Reporter: Tibor Digana
>            Assignee: Tibor Digana
>             Fix For: 2.20.1
>
>
> Another flush is necessary because the method {{AbstractCommandStream.read()}} is called
> in a loop and the flush should be called after last byte. This normally happens if the loop is not stopped. If another thread marks the {{AbstractCommandStream}}'s Thread to be closed asynchronously, then the bytes can be lost in the Thread calling {{read()}} method.
> Therefore flushing if stream has been marked for closing it in the intermediate time between these two threads.
> If {{InputStream}} is closed after marking it then no flush helps of course.
> This was on the side of Maven process which sends commands to forked JVM. If the fork does not receive complete data, even if flushed by Maven process, nothing special happens. The fork remains in the state of reading till command is read complete or stops after JVM timing out or JVM is killed. If the fork receives complete command, even better.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)