From ccfccc8fab4f3936f12f9dc869deb0d9a2e55236 Mon Sep 17 00:00:00 2001 From: jiangjiang <366649270@qq.com> Date: Wed, 4 Aug 2021 01:54:34 +0800 Subject: [PATCH] Update ssh_session_manager.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bug fix: - 修复死锁 --- ssh_session_manager.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssh_session_manager.go b/ssh_session_manager.go index fe63353..d164ce7 100644 --- a/ssh_session_manager.go +++ b/ssh_session_manager.go @@ -171,9 +171,10 @@ func (this *SessionManager) RunAutoClean() { timeoutSessionIndex := this.getTimeoutSessionIndex() this.sessionCacheLocker.Lock() for _, sessionKey := range timeoutSessionIndex { - this.LockSession(sessionKey) + // this deal lock for runcmd + //this.LockSession(sessionKey) delete(this.sessionCache, sessionKey) - this.UnlockSession(sessionKey) + //this.UnlockSession(sessionKey) } this.sessionCacheLocker.Unlock() time.Sleep(30 * time.Second)