RFR 8185719 [testlibrary] : RMI TestSocketFactory does not flush
Roger.Riggs at Oracle.com
Wed Aug 2 15:32:20 UTC 2017
I considered keeping track of the partial match across the flush, but it
could only work
if the partial match was a prefix of the replacement string. It got
Since this is used (only) for RMI, in which flushes are used at the end
of messages, it seemed
sufficient to document it as not working across flushes and with a debug
if flush was in the middle of a partial match.
On 8/2/2017 11:25 AM, Daniel Fuchs wrote:
> Hi Roger,
> I wonder if the MatchReplaceOutputStream should store the
> partial match index at the time the partial bytes are flushed
> in order to verify that this was indeed a partial match,
> and report an error if it later finds that flush() was indeed
> called during a full match? The potential Error to throw could
> be created and recorded in flush() in order to diagnose
> the offending flush() call...
> On the other hand to do this properly you'd probably need
> to maintain a stack of partial match indexes and corresponding
> potential Errors to throw in case flush() is called again with
> a partial match while the previous partial matching hasn't
> been invalidated yet...
> I mean - if your matched bytes are stg like 0 0 0 6
> and the stream looks like:
> 3 0 0 <flush> 0 <flush> ...
> then either 6 or 0 0 6 coming after the second flush would
> make the test fail to find & replace the full match...
> But maybe it's not worth it if you are sure that flush() cannot
> be called during a full match/replace sequence?
> best regards,
> -- daniel
> On 02/08/2017 15:21, Roger Riggs wrote:
>> Please review a correction in the RMI TestSocketFactory
>> MatchReplaceOutputStream to correctly flush
>> partial matches. It can cause hangs when the one or more bytes
>> before a flush are a partial match
>> for the pattern and the consumer is waiting for the pending bytes.
>> Thanks, Roger
More information about the core-libs-dev