[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] New topic in forum Eclipse Communications Framework (ECF), called Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again, by Chris Lake

Title: Eclipse Community Forums
Subject: Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again Author: Chris Lake Date: Wed, 12 July 2017 05:31
Hi,

I'm trying to isolate a problem a user has downloading plugins from a p2 repo. After much searching and debugging I finally came across https://bugs.eclipse.org/bugs/show_bug.cgi?id=219368.

So now I'm looking for some kind of confirmation of what I've found and whether a new bug needs to be raised.

So the above bug is exactly the problem we are experiencing. However, the fix that was applied no longer seems to work. I've found that the setting of the System properties doesn't apply to the created connection. This ties up with a SO question someone else found (https://stackoverflow.com/questions/39959775/httpurlconnection-timeout-not-working-by-setting-the-system-properties)

Looking at
org/eclipse/ecf/provider/filetransfer/retrieve/UrlConnectionRetrieveFileTransfer.java
, the connection is created as
urlConnection = getRemoteFileURL().openConnection();
.

Trying a simple application, we can see the following:
  System.setProperty("sun.net.client.defaultConnectTimeout", "120000");
  System.setProperty("sun.net.client.defaultReadTimeout", "120000");

  URL bundleUrl = new URL(BASEURL + "/plugins/" + bundleName);
  URLConnection bundleUrlConn = bundleUrl.openConnection();

  // Using the IDE you can see:
  // bundleUrlConn.connectTimeout (HttpURLConnection)= -1
  // bundleUrlConn.connectTimeout (URLConnection) = 0
  // bundleUrlConn.readTimeout (HttpURLConnection)= -1
  // bundleUrlConn.readTimeout (URLConnection) = 0

  // So the following is required to set the properties correctly
  bundleUrlConn.setConnectTimeout(10000);
  bundleUrlConn.setReadTimeout(10000);


So I think the fix needs to be updated to use the set*Timeout methods. Does that sound about right?


Chris
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]