-
Bug
-
Resolution: Fixed
-
P4
-
7u79, emb-8u6, 9
-
b123
-
arm, ppc
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8261293 | 8u301 | Chris Hegarty | P4 | Resolved | Fixed | b01 |
JDK-8261305 | 7u311 | Chris Hegarty | P4 | Resolved | Fixed | b01 |
The test sun/net/www/http/ChunkedOutputStream/checkError.java was written to check the fix for
When the test is running with option -Xcomp we receive the following output:
gtee@emb-spb-imx53-hf-1:~$ $JAVA_HOME/bin/java -Xcomp -XX:+UseSerialGC -Dprofile.jre -cp JTwork/classes/sun/net/www/http/ChunkedOutputStream checkError
HTTP-client>Starting default Http-server
waiting server to be start
assigning 1024 to the chunk length
Server started
sending 1048576 bytes
Exception in thread "main" HTTP version: HTTP/1.1
User-Agent: Java/1.8.0_06-ea
Host: localhost:59534
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
receiving data
Server socket is closed
java.lang.RuntimeException: Test Failed: haven't received the expected IOException
at checkError.testExit(checkError.java:121)
at checkError.main(checkError.java:115)
With option -Xmixed:
gtee@emb-spb-imx53-hf-1:~$ $JAVA_HOME/bin/java -Xmixed -XX:+UseSerialGC -Dprofile.jre -cp JTwork/classes/sun/net/www/http/ChunkedOutputStream checkError
HTTP-client>Starting default Http-server
waiting server to be start
assigning 1024 to the chunk length
Server started
sending 1048576 bytes
HTTP version: HTTP/1.1
User-Agent: Java/1.8.0_06-ea
Host: localhost:60668
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
receiving data
Server socket is closed
TEST PASSED
The current test implementation very depends on two unaccounted factors:
1) size of underlying TCP buffers:
# cat /proc/sys/net/ipv4/tcp_wmem
4096 16384 4001344
The maximum size of TCP buffer on the failed board is about 3.8Mb, that means 'write' operation in this test might not be blocked. Thus the client can easily write 1Mb to the server but it doesn't guarantee that something has been read on the server side.
2) thread scheduler:
It's not known how will cooperate client and server threads, the server thread may wake up to late when the client thread has finished its work.
One of the solution could be adding Thread.sleep(50) after every 'write' operation. It should take a chance to the server thread to do some work. However, the main problem in the test is its design, testing of so simple functionality could be done without involving network and threading functionality.
- backported by
-
JDK-8261293 [TESTBUG] sun/net/www/http/ChunkedOutputStream/checkError.java fails on some systems
- Resolved
-
JDK-8261305 [TESTBUG] sun/net/www/http/ChunkedOutputStream/checkError.java fails on some systems
- Resolved
- relates to
-
JDK-8157539 Mark sun/net/www/http/ChunkedOutputStream/checkError.java as intermittently failing
- Closed
-
JDK-5054016 get the failure immediately when writing individual chunks over socket fail
- Resolved
-
JDK-8157499 Mark several tests from jdk_net as intermittently failing
- Closed
-
JDK-8159012 Problem list sun/net/www/http/ChunkedOutputStream/checkError.java
- Closed