RFR: 8222968 ByteArrayPublisher is not thread-safe resulting in broken re-use of HttpRequests
Chris Hegarty
chris.hegarty at oracle.com
Thu Jun 27 10:50:00 UTC 2019
Michael,
> On 27 Jun 2019, at 11:08, Michael McMahon <michael.x.mcmahon at oracle.com> wrote:
>
> Could I get the following change reviewed please:
>
> The change is as suggested in the report and the test case
> is based on the one provided.
>
> http://cr.openjdk.java.net/~michaelm/8222968/webrev.1/index.html
If I’m not mistaken, then after this change there will be no explicit
reference to the PullPublisher. There is an implicit reference from the
nested Subscription. I think this should be ok, but just want to ensure
that this has been considered.
On the test:
1) Can you please split the long line, L48. Maybe import the nested
BodyPublisher and BodyPublishers types. And move the byte array
initialization to a constant declaration ( that way the test can also
assert that it received the correct response body )
2) Given the teststabilization work that is ongoing, the test should
probably use the loopback, for both binding and connecting. Also,
rather than using the IPv4 loopback literal, defer to the loopback
InetAddress to retrieve the host address ( which may be IPv6 ).
-Chris.
More information about the net-dev
mailing list