Skip to content

Commit 74fdcb1

Browse files
authored
fix(agent/agentssh): wait for sessions to exit (#8008)
1 parent 794a551 commit 74fdcb1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

agent/agentssh/agentssh.go

+2
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,11 @@ func (s *Server) trackSession(ss ssh.Session, add bool) (ok bool) {
648648
// Server closed.
649649
return false
650650
}
651+
s.wg.Add(1)
651652
s.sessions[ss] = struct{}{}
652653
return true
653654
}
655+
s.wg.Done()
654656
delete(s.sessions, ss)
655657
return true
656658
}

0 commit comments

Comments
 (0)