[
https://issues.apache.org/jira/browse/SUREFIRE-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tibor Digana closed SUREFIRE-1380.
----------------------------------
Resolution: Fixed
https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git;a=commit;h=f1f3b6fab9e6179a9faa7537be49354fa58e7685
> 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)