Two Laptop Bag*
The moose likes Other Open Source Projects and the fly likes JSch not closing sshd? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JSch not closing sshd?" Watch "JSch not closing sshd?" New topic
Author

JSch not closing sshd?

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi all,

Has anyone seen where JSch leaves sshd sessions open?

I've got a java client which performs regular SFTP connections (it polls every 30 seconds) and it seems to occasionally (but not always) leave behind a sshd session. These eventually build up over time and causes us to have a "too many files open" exception in the OS (it hits the limit per process for those who are interested).

In my client I close the SFTPChannel, then the Channel (redundant really as closing the SFTPChannel closes the Channel) and lastly the Session, so I'm pretty sure I'm cleaning up correctly (and I can see I have a 'disconnect' for each 'connect', so they do marry up).

This occurs with 0.1.34, 0.1.38 and 0.1.40, running on OpenSSH and *NIX


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSch not closing sshd?
 
Similar Threads
File Upload Error - Using JSCH/SFTP
Can't connect to ssh server using jsch or sshtools -- OpenSSL misconfiguration or coding error?
JSP page to call unix scrpit
Compiling on a network.
Coonection to the remote host failed in ubuntu 9.10