Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure we reap SSH process on Close() #177

Merged

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Apr 4, 2024

System transport can get stuck on the Read call because of pty implementation details (see #174) for more details.

This makes sure that we kill the SSH process when the transport is closed, and in turn makes sure that the rest of the components (channel, drivers) can shutdown properly.

I also added a test simulating a blocking (stuck) SSH server and a non blokcing SSH server (non blocking showed that it's fine to kill an already defunct process).

System transport can get stuck on the Read call because of
pty implementation details (see scrapli#174)
for more details.

This makes sure that we kill the SSH process when the transport
is closed, and in turn makes sure that the rest of the components (channel, drivers)
can shutdown properly.

I also added a test simulating a blocking (stuck) SSH server
and a non blokcing SSH server (non blocking showed that it's fine
to kill an already defunct process).

Signed-off-by: Francois Espinet <[email protected]>
@carlmontanari
Copy link
Contributor

@netixx sorry for the big changes -- let me know if you are good with this.

I did what you did, just with std library since (for now?) we want to keep that crypto pin for 1.16 happiness.

annnnd I just saw it failed in ci (worked on my machine!) so will investigate that.

@carlmontanari
Copy link
Contributor

I think im going to merge this and then the other branch to main so that I can get tmate setup working so I can troubleshoot the system transport in ci issue. python version of this works w/ the TERM env set so not sure what's up here. @netixx comment back here or ill catch ya in discord if you wanna see any changes/tweaks to this!

@carlmontanari carlmontanari merged commit 06f5656 into scrapli:fix/read-goroutine-fixups Apr 5, 2024
0 of 14 checks passed
@carlmontanari
Copy link
Contributor

ok, test fixed/ci passing now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants