[
https://issues.apache.org/jira/browse/SUREFIRE-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tibor Digana updated SUREFIRE-1380:
-----------------------------------
Description:
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, nothing special
happens. The fork remains in the state of reading complete command or stops
after timing out.
was:
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.
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, nothing special
happens. The fork remains in the state of reading complete command or stops
after timing out.
If {{InputStream}} is closed after marking it then no flush helps of course.
> 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, nothing special
> happens. The fork remains in the state of reading complete command or stops
> after timing out.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)