Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Random socket-timeout at org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveFileTransfer

Hi Scott,

Thanks a lot for the valuable insight. I have included the httpclient based ecf provider in our app, but I've used a very old version I guess. Following are the ecf related bundles in the system.

id    State       Bundle
48    ACTIVE      org.eclipse.ecf_3.1.300.v20110531-2218
49    ACTIVE      org.eclipse.ecf.filetransfer_5.0.0.v20110531-2218
50    ACTIVE      org.eclipse.ecf.identity_3.1.100.v20110531-2218
51    ACTIVE      org.eclipse.ecf.provider.filetransfer_3.2.0.v20110531-2218
52    ACTIVE      org.eclipse.ecf.provider.filetransfer.httpclient_1.0.0.v20070627-1030
82    ACTIVE      org.eclipse.equinox.p2.transport.ecf_1.0.100.v20110902-0807

Maybe I should upgrade the httpclient-based provider to the latest stable. I couldn't do it immediately using org.eclipse.ecf.provider.filetransfer.httpclient_4.0.200.v20120504-2322 due to import version mismatches with the org.apache dependencies exported from the other bundles in the system. I will integrate this, by clearing out the import/export versions of org.apache dependencies and try to reproduce the same error.

Thanks again for your help! :)

Regards,
Dileepa

On Fri, May 18, 2012 at 3:15 AM, Scott Lewis <slewis@xxxxxxxxxxxxx> wrote:
Hi Dileepa,

Before discussing this error...I can reach this repository

http://wso2.org/bamboo/artifact/WSO2CARBON-P2REPO/JOB1/build-97/P2-Repo/p2-repo/content.jar

just fine using the httpclient 3.1-based provider (i.e. that's the one p2/Eclipse uses by default).

I can see from the below that you are not using the httpclient-based provider (i.e. org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveFileTransfer is the UrlConnection-based provider).  In general we've found the httpclient-based provider to be more reliable...and put more effort into making it more reliable...because that's what Eclipse/p2 are using.  You can use the httpclient-based provider if you wish in your own application (you just need to include a few more plugins).

Now, about the error you are seeing in the UrlConnection-based provider...I tried retrieving this url:

http://wso2.org/bamboo/artifact/WSO2CARBON-P2REPO/JOB1/build-97/P2-Repo/p2-repo/artifacts.jar

and it retrieved it without any exceptions in three ECF filetransfer test runs.  So in other words, it seems I can't immediately reproduce the problem you are experiencing with this URL (I did artifacts.jar rather than content.jar because right now I'm on a slow link).

It is quite possible, then, that what you are experiencing is due to some difference in system/configuration...it could be any one of:

1) Difference in java version (because it's using UrlConnection, the underlying socket handling code is different)
2) Difference in OS (maybe there's some lower-layer problem with Sockets on your system)
3) The java configuration (e.g. timeouts set very low)...i.e. the vm defines these as defaults for connect and read timeout

sun.net.client.defaultConnectTimeout
sun.net.client.defaultReadTimeout

That's all I can think of for the moment.

My initial suggestion is to add in/use the httpclient provider...with is in

org.eclipse.ecf.provider.filetransfer.httpclient
org.eclipse.ecf.provider.filetransfer.httpclient.ssl

and the org.apache dependencies (o.a.commons.httpclient, o.a.commons.logging, and o.a.commons.codec)

If that doesn't/can't work out, then I'm willing to help you figure out what's going wrong with the urlconnection-based provider...but the first thing to do there is to figure out why I can't reproduce what you are experiencing.

Thanks,

Scott



On 5/17/2012 12:33 PM, Dileepa Jayakody wrote:
Hi Guys,

We use equinox p2 as our provisioning platform. We also use ecf.transport to stream remote p2 Repositories.Recently I came across the below error [1] when trying to add a remote P2 repository. 
It complains about a socket time out, at org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveFileTransfer.getDecompressedStream(UrlConnectionRetrieveFileTransfer.java:542). However this error is thrown within a minute trying to add the repo, so I doubt if it's really due to a socket time out.
The error is intermittent & can be reproduced on a Windows machine more frequently than on Ubuntu.

Any idea what's going wrong here?  Could this be dependent on the network configurations of the particular machine or OS (firewall, virus guard etc)?
Appreciate any thoughts/tips to find the root cause of this.

[1] Error stack-trace
Caused by: org.eclipse.equinox.p2.core.ProvisionException: Unable to read reposi
p2-repo/content.jar.
        at org.eclipse.equinox.internal.p2.repository.CacheManager.updateCache(C
acheManager.java:359)
        at org.eclipse.equinox.internal.p2.repository.CacheManager.createCache(C
acheManager.java:205)
        at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRep
ositoryFactory.getLocalFile(SimpleMetadataRepositoryFactory.java:66)
        at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRep
ositoryFactory.load(SimpleMetadataRepositoryFactory.java:88)
        at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositor
yManager.factoryLoad(MetadataRepositoryManager.java:57)
        at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepository
Manager.loadRepository(AbstractRepositoryManager.java:749)
        at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepository
Manager.loadRepository(AbstractRepositoryManager.java:651)
        at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositor
yManager.loadRepository(MetadataRepositoryManager.java:96)
        at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositor
yManager.loadRepository(MetadataRepositoryManager.java:92)
        at org.wso2.carbon.feature.mgt.core.util.RepositoryUtils.addRepository(R
epositoryUtils.java:74)
        ... 12 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:643)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:589)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1319)
        at org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveF
ileTransfer.getDecompressedStream(UrlConnectionRetrieveFileTransfer.java:542)
        at org.eclipse.ecf.provider.filetransfer.retrieve.UrlConnectionRetrieveF
ileTransfer.openStreams(UrlConnectionRetrieveFileTransfer.java:312)
        at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTr
ansfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:889)
        at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTr
ansfer.sendRetrieveRequest(AbstractRetrieveFileTransfer.java:576)
        at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveA
dapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:106)
        at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.sendRetrieve
Request(FileReader.java:349)
        at org.eclipse.equinox.internal.p2.transport.ecf.FileReader.readInto(Fil
eReader.java:295)
        at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.dow
nload(RepositoryTransport.java:87)
        at org.eclipse.equinox.internal.p2.transport.ecf.RepositoryTransport.dow
nload(RepositoryTransport.java:137)
        at org.eclipse.equinox.internal.p2.repository.CacheManager.updateCache(C
acheManager.java:333)
        ... 21 more

Thanks,
Dileepa



_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev


_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev




--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616


Back to the top