I've done a few experiments about this, and I'm just curious, why thread, which
is (i guess) establishing the connection, gets stuck, and does not end with
timeout?:
"Executor #0 for Sol-10-2-stable" Id=51 RUNNABLE (in native)
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:182)
at com.jcraft.jsch.IO.getByte(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at be.certipost.hudson.plugin.SCPSite.createSession(SCPSite.java:117)
at
be.certipost.hudson.plugin.SCPRepositoryPublisher.perform(SCPRepositoryPublisher.java:86)
when i was experimenting with this on my local Hudson instance, connector thread
looked slightly different:
"Executor #1 for master" Id=20 RUNNABLE (in native)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:310)
- locked java.net.SocksSocketImpl@836869
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:176)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:381)
at java.net.Socket.connect(Socket.java:537)
at java.net.Socket.connect(Socket.java:487)
at java.net.Socket.(Socket.java:384)
at java.net.Socket.(Socket.java:198)
at com.jcraft.jsch.Util.createSocket(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at be.certipost.hudson.plugin.SCPSite.createSession(SCPSite.java:117)
at
be.certipost.hudson.plugin.SCPRepositoryPublisher.perform(SCPRepositoryPublisher.java:91)
moreover, it ended up with timeout exception:
com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out
at com.jcraft.jsch.Util.createSocket(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
which is correct.
So the problem seems to be that JSch library is not able to recognize disability
to connect under some circumstances and treat it with appropriate exception.
Due to the synchronous nature of Java I/O, interrupting the I/O activity is very
difficult.
When it happens next time, please go to http://server/hudson/threadDump to
obtain the thread dump of the system, so that we can know where the thread is stuck.