Hi,
 
I've been experiencing polling threads hanging (I've added the stack trace at 
the bottom of the mail). I've done a bit of tinkering under the hood/debugging 
and found that socket connect timeouts are set to 0, so a timeout never occurs 
when attempting to connect to the subversion repository. Looking at the code in 
SubversionSCM.java a new instance of FilterSVNAuthenticationManager is created 
(line 2060 - in method  getRepository()) which has an override of 
getReadTimeout() to set a default timeout value if nothing is set. Though this 
is just for the read timeouts, the ISVNAuthenticationManager interface also has 
a getConnectTimeout(). I was wondering if it may be prudent to override it too 
(suggested code below). SVNKit is currently returning a timeout value of 0 when 
getConnectTimeout() is being called.
 
        protected SVNRepository getRepository(AbstractProject context, SVNURL 
repoURL) throws SVNException {
            SVNRepository repository = SVNRepositoryFactory.create(repoURL);
 
            ISVNAuthenticationManager sam = 
createSvnAuthenticationManager(createAuthenticationProvider(context));
            sam = new FilterSVNAuthenticationManager(sam) {
                // If there's no time out, the blocking connect and read 
operation may hang forever, because TCP itself
                // has no timeout. So always use some time out. If the 
underlying implementation gives us some
                // value (which may come from ~/.subversion), honor that, as 
long as it sets some timeout value.
                @Override
                public int getConnectTimeout(SVNRepository repository) {
                    int r = super.getConnectTimeout(repository);
                    if(r<=0)    r = DEFAULT_TIMEOUT;
                    return r;
                }
                @Override
                public int getReadTimeout(SVNRepository repository) {
                    int r = super.getReadTimeout(repository);
                    if(r<=0)    r = DEFAULT_TIMEOUT;
                    return r;
                }
            };
            repository.setTunnelProvider(createDefaultSVNOptions());
            repository.setAuthenticationManager(sam);
 
            return repository;
        }
 
I was also going to have a chat with the SVNKit guys too, the connect timeout 
probably should have a different default value too.
 
Cheers
Peter Ineson
 
 
Stuck polling job stack trace.
 
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:529)
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
org.tmatesoft.svn.core.internal.util.SVNSocketFactory.connect(SVNSocketFactory.java:112)
org.tmatesoft.svn.core.internal.util.SVNSocketFactory.createSSLSocket(SVNSocketFactory.java:85)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:270)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:435)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:373)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:364)
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:708)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:628)
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:103)
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1018)
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:99)
hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:2038)
hudson.scm.SubversionSCM.repositoryLocationsNoLongerExist(SubversionSCM.java:2217)
hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1232)
hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
hudson.scm.SCM.poll(SCM.java:373)
hudson.model.AbstractProject._poll(AbstractProject.java:1487)
hudson.model.AbstractProject.poll(AbstractProject.java:1404)
hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439)
hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468)
hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
java.util.concurrent.FutureTask.run(FutureTask.java:138)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to