[JSch-users] Infinite loop/hang on connect
Status: Alpha
Brought to you by:
ymnk
From: Adam F. <afa...@in...> - 2006-02-28 03:00:49
|
Hello fellow jsch-users (and author). I've been using jsch for some time, now at version 0.1.24, and am now having an occasional hang problem. This software is running on remote servers... I can't have it hanging! Here's the thread's stack trace where it gets stuck: "CommAgent" prio=1 tid=0x4de2b3f8 nid=0x8fa waiting on condition [0xbddff000..0xbddff65c] at java.lang.Thread.sleep(Native Method) at com.jcraft.jsch.Session.write(Unknown Source) at com.jcraft.jsch.Session.connect(Unknown Source) at com.intelio.common.io.SSHConnection.connect(SSHConnection.java:84) at com.intelio.common.comm.PayloadTransmitter.sendPackages(PayloadTransmitter.java:253) at com.intelio.common.comm.PayloadTransmitter.run(PayloadTransmitter.java:113) at com.intelio.edge.agent.comm.CommAgent.execute(CommAgent.java:164) at com.intelio.edge.component.Component.run(Component.java:92) Apparently the variable "in_kex" never becomes true. I'm not sure about the interaction here, but apparently its waiting for another thread to change the value. Without a synchronization or declaring the variable as volatile, could it be that the value is in fact changing and it just isn't noticing? It seems to me that the CPU cache would flush eventually, while this is hanging for hours (until I receive a notice that files are piling up because the transfer is stuck, and I kill it). Anyway, I do think that the variable needs to be declared volatile, but it probably would only solve a short hang, not an infinite one. Any other ideas? -- Adam Fanello Sr. Engineer/Architect Intelio Technologies, Inc |