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 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


Back to the top