Skip to content

BACKPORT: Handle case when proxy command dies during a read - #995

Closed
nbartos wants to merge 1 commit into
paramiko:2.0from
nbartos:proxydeath-2.0
Closed

nbartos wants to merge 1 commit into
paramiko:2.0from
nbartos:proxydeath-2.0

Conversation

@nbartos

@nbartos nbartos commented Jun 13, 2017

Copy link
Copy Markdown

If the proxy command dies during a read loop, we end up in a tight
loop that causes the process to max out a cpu until it's forcefully
killed.

In my experience, the easiest way to trigger this condition is to
use a proxy command and add some text to /etc/nologin on the
destination host (not the proxy host).

Another way to trigger this condition is to send a CTRL+C wile the
second command is running:

chan.exec_command('sleep 100')
stderr = chan.makefile_stderr('rb').read()

If the proxy command dies during a read loop, we end up in a tight
loop that causes the process to max out a cpu until it's forcefully
killed.

In my experience, the easiest way to trigger this condition is to
use a proxy command and add some text to /etc/nologin on the
destination host (not the proxy host).

Another way to trigger this condition is to send a CTRL+C wile the
second command is running:

chan.exec_command('sleep 100')
stderr = chan.makefile_stderr('rb').read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant