JDK-8022661 : InetAddress.writeObject() performs flush() on object output stream
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7u21,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • Submitted: 2013-06-14
  • Updated: 2014-02-06
  • Resolved: 2013-08-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u45Fixed 8 b105Fixed
Description
FULL PRODUCT VERSION :
1.7.0_21-b11

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Windows Server 2008

A DESCRIPTION OF THE PROBLEM :
InetAddress.writeObject performs flush() on object output stream.

That spoils TCP throughput when the output stream is based on a socket channel of a TCP connection, since the SYN ACK delay of 2ms of Windows will be invoked when a packet is smaller than the MTU and the next packet is about to be sent.


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Go to Java 7 update 15. Or insert a filtering output stream ignoring the flush().
Comments
Based on the nighlty test run results for the build where the fix had been integreated SQE is OK to take it inot CPU13_04.
2013-08-21

Adding CPU13_04-critical-watch: This is a regression from a previous security release, 7u21. The fix is small and localized. Risk is low.
2013-08-12

SQE ok to defer from 7u40.
2013-08-09

Need SQE-OK to defer for 7u40.
2013-08-09

Adding 7u40-defer-request: This bug can manifest itself as a small performance regression, if the InetAddress is being serialized to a socket stream. However, this is a small performance hit, and unlikely to be a problem unless the application is serializing a large number of InetAddress instances. While I would like to defer this bug from 7u40 (due to it coming to our attention late in the release cycle ), I think it should be fixed in the next available 7 update, 7u45. Fixing in 7u45 may also be justified since the issue is a regression introduced in 7u21.
2013-08-09

The flush() is completely unnecessary and should be removed. This could considered a minor performance regression, and was inadvertently introduced by 8000724.
2013-08-09