JSch不关闭sshd [英] JSch not closing sshd

查看:81
本文介绍了JSch不关闭sshd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人看到JSch在sshd会话打开的地方吗?

Has anyone seen where JSch leaves sshd sessions open?

我有一个Java客户端,它执行常规的SFTP连接(它每隔一小时轮询一次),并且似乎留下了一个sshd会话.这些最终会随着时间的流逝而累积,并导致我们在操作系统中出现打开文件过多" 异常(对于有兴趣的人,每个进程的限制都达到了(1024)个限制).

I've got a java client which performs regular SFTP connections (it polls every one hour) and it seems to 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(1024) for those who are interested).

在我的客户端中,我关闭SFTPChannel,然后关闭Channel(实际上是冗余的,因为关闭SFTPChannel关闭了Channel),最后关闭了Session,所以我确定我正确地进行了清理(可以看到我有一个每个连接"都断开",所以他们结婚了)

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)

推荐答案

请参考该问题是由较旧的OpenSSH sshd中的错误引起的. 最新的OpenSSH已修复它.

That problem has been caused by a bug in older OpenSSH's sshd. The recent OpenSSH has fixed it.

这篇关于JSch不关闭sshd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆