RE: [JSch-users] Infinite loop/hang on connect
Status: Alpha
Brought to you by:
ymnk
From: Ned M. <Edw...@va...> - 2006-02-28 03:49:32
|
I had a similar problem with the sftp connection that would occur very occassionally. The workaround I implemented was certainly not an eloquent one but it has worked. Basically, I created a very simple class that would start a timer when the connection call was made. If the call had not returned within some liberal amount of time (say 1 minute) I interupted the thread and retried the operation. Like I said, not real pretty but it has done the trick. -----Original Message----- From: Adam Fanello To: jsc...@li... Sent: 2/27/2006 10:00 PM Subject: [JSch-users] Infinite loop/hang on connect 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(PayloadTransmitt er.java:253) at com.intelio.common.comm.PayloadTransmitter.run(PayloadTransmitter.java:1 13) 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 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JSch-users mailing list JSc...@li... https://lists.sourceforge.net/lists/listinfo/jsch-users |