Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Communications Framework (ECF) » Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again(Indefinite hang on HTTP connection to unresponsive site Bug 219368)
Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again [message #1767900] Wed, 12 July 2017 05:31 Go to next message
Chris Lake is currently offline Chris LakeFriend
Messages: 25
Registered: November 2015
Junior Member
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
Re: Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again [message #1767910 is a reply to message #1767900] Wed, 12 July 2017 06:46 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Chris Lake wrote on Wed, 12 July 2017 01: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)



Hi Chris. A great deal has changed since 219368 so my first question would be: what version of Eclipse and ECF are you using? Is it possible for me to reproduce the problem you are experiencing? (e.g. is there a public p2 repo where you are doing your testing?).

Some observations that might be helpful for diagnosis: the default file transfer provider is now based upon apache httpcomponent/httpclient (v4 in Oxygen). The urlconnection-based provider is typically not used, although it can be used in some proxy situations. It basically is a backup. The primary is HttpClientRetrieveFileTransfer. In HttpClientRetrieveFileTransfer.openStreams is the setting of the read and connect timeouts:

try {
httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, getSocketReadTimeout());
int connectTimeout = getConnectTimeout();
httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout);

these default to 120000ms (2 minutes) as you can see in HttpClientOptions class. These can be changed via the system properties listed in HttpClientOptions, or overridden for every file transfer (in options). Will this allow you to set the default to something more appropriate for your environment? (i.e. 10000ms)

Let me know and we will continue to diagnose.

Also...you may get more/faster response by joining the ecf-dev@eclipse.org mailing list: https://dev.eclipse.org/mailman/listinfo/ecf-dev and posting there, although this forum is fine too.
Re: Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again [message #1767911 is a reply to message #1767900] Wed, 12 July 2017 06:47 Go to previous messageGo to next message
Scott Lewis is currently offline Scott LewisFriend
Messages: 1038
Registered: July 2009
Senior Member
Chris Lake wrote on Wed, 12 July 2017 01: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)



Hi Chris. A great deal has changed since 219368 so my first question would be: what version of Eclipse and ECF are you using? Is it possible for me to reproduce the problem you are experiencing? (e.g. is there a public p2 repo where you are doing your testing?).

Some observations that might be helpful for diagnosis: the default file transfer provider is now based upon apache httpcomponent/httpclient (v4 in Oxygen). The urlconnection-based provider is typically not used, although it can be used in some proxy situations. It basically is a backup. The primary is HttpClientRetrieveFileTransfer. In HttpClientRetrieveFileTransfer.openStreams is the setting of the read and connect timeouts:

try {
httpClient.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, getSocketReadTimeout());
int connectTimeout = getConnectTimeout();
httpClient.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout);

these default to 120000ms (2 minutes) as you can see in HttpClientOptions class. These can be changed via the system properties listed in HttpClientOptions, or overridden for every file transfer (in options). Will this allow you to set the default to something more appropriate for your environment? (i.e. 10000ms)

Let me know and we will continue to diagnose.

Also...you may get more/faster response by joining the ecf-dev@eclipse.org mailing list: https://dev.eclipse.org/mailman/listinfo/ecf-dev and posting there, although this forum is fine too.
Re: Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again [message #1768015 is a reply to message #1767911] Wed, 12 July 2017 23:38 Go to previous messageGo to next message
Chris Lake is currently offline Chris LakeFriend
Messages: 25
Registered: November 2015
Junior Member
Hi Scott,

Thanks for the quick response.

Quote:
what version of Eclipse and ECF are you using? Is it possible for me to reproduce the problem you are experiencing?


At the moment we still rely on the versions from Juno (there are plans to at least update to Neon, but GUI issues are holding that back). There is no public repo available that I could guarantee reproduction. In fact, there is only one person in our QA team who can reproduce the problem.

I'll see if a I can get a Neon build done and ask the guy to give that a go to see if that helps (it might even be the push I need to get the update happening).

Chris
Re: Bug 219368 - Indefinite hang on HTTP connection to unresponsive site - back again [message #1792922 is a reply to message #1768015] Wed, 25 July 2018 23:41 Go to previous message
Chris Lake is currently offline Chris LakeFriend
Messages: 25
Registered: November 2015
Junior Member
A year later I've got time to get back to this.

Looking over my bug ticket and re-reading this post I realized we were not even distributing the org.eclipse.ecf.provider.filetransfer.httpclient4 bundle with our software, hence it always used the "backup" urlconnection-based provider. Including the bundle with our software has it auto-magically picked up and used so now, although in this environment we still get hanging downloads, they do timeout correctly and eventually all downloads are successful.

Thanks for the help.
Previous Topic:Different ECF OSGi remote services (Neon.3 vs Photon) do not work together
Next Topic:Setting endpoint URL context - JAX-RS, Jersey, Jetty
Goto Forum:
  


Current Time: Mon Oct 14 11:47:49 GMT 2024

Powered by FUDForum. Page generated in 0.03765 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top