JDK-8174919 : SocketException no longer handled by WebView when processing web pages
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u152,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-02-14
  • Updated: 2020-01-31
  • Resolved: 2017-02-15
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 Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u152Fixed 9Fixed
Related Reports
Relates :  
Description
We are getting frequent timeouts in two of our web tests:

test.javafx.scene.web.LoadTest > testLoadUrlWithUnencodedSpaces FAILED
    java.lang.AssertionError: Waiting timed out
        at test.javafx.scene.web.TestBase.wait(TestBase.java:238)
        at test.javafx.scene.web.TestBase.waitLoadFinished(TestBase.java:289)
        at test.javafx.scene.web.TestBase.load(TestBase.java:116)
        at test.javafx.scene.web.LoadTest.testLoadUrlWithUnencodedSpaces(LoadTest.java:165)

test.javafx.scene.web.LoadTest > testLoadUrlWithEncodedSpaces FAILED
    java.lang.AssertionError: Waiting timed out
        at test.javafx.scene.web.TestBase.wait(TestBase.java:238)
        at test.javafx.scene.web.TestBase.waitLoadFinished(TestBase.java:289)
        at test.javafx.scene.web.TestBase.load(TestBase.java:116)
        at test.javafx.scene.web.LoadTest.testLoadUrlWithEncodedSpaces(LoadTest.java:157)

This regression is caused by the fix for JDK-8158196.
Comments
Changeset: fd5864815331 Author: ghb Date: 2017-02-15 10:02 +0530 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/fd5864815331
15-02-2017

+1 This change matches to prev. behaviour. and throw ex; will help to handle other types of Socket Exceptions (like NoRouteToHostException , ConnectException ) also..
14-02-2017

+1 (would be good to get a second reviewer, too)
14-02-2017

Thanks [~kcr] for Root cause and its solution, Please find webrev: http://cr.openjdk.java.net/~ghb/8174919/webrev.00/ Tested on Mac and Win.
14-02-2017

The fix for JDK-8158196 catches SocketException to check for the case where a connection is reset so it can retry it. However, the SocketException is not rethrown in case it isn't a connection reset (or after one retry). The following should be added to fix this new failure: diff --git a/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java b/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java --- a/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java +++ b/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java @@ -176,6 +176,8 @@ if ("Connection reset".equals(ex.getMessage()) && connectionResetRetry) { connectionResetRetry = false; continue; + } else { + throw ex; } } finally { close(c);
14-02-2017