Skip to content

Issue #822 - Allow channel._handle_close to bypass session rekey block - #833

Open
tsellers-r7 wants to merge 1 commit into
paramiko:mainfrom
tsellers-r7:close_channel_vs_rekey
Open

tsellers-r7 wants to merge 1 commit into
paramiko:mainfrom
tsellers-r7:close_channel_vs_rekey

Conversation

@tsellers-r7

Copy link
Copy Markdown

This PR attempts to address Issue #822 opened by @mathrick

The change adds an argument to transport._send_user_message that allows the message to be sent during key negotiation. channel._handle_close is modified to set this argument to True to enable the closure of a channel even after a rekey has been requested by the client. Normally this closure message (cMSG_CHANNEL_CLOSE) would be blocked in transport._send_user_message until after the rekey process has completed. In some cases, as demonstrated in Issue #822, this never occurs and the connection errors out.

After implementing this change the demo code in Issue #822 was able to run for at least 700 loop iterations. Prior to the change the best I was able to achieve was 4 iterations before hitting the issue.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 74.241% when pulling bb29a8c on tsellers-r7:close_channel_vs_rekey into 7366f96 on paramiko:master.

@coveralls

coveralls commented Oct 25, 2016 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.05%) to 74.254% when pulling bb29a8c on tsellers-r7:close_channel_vs_rekey into 7366f96 on paramiko:master.

@bitprophet

Copy link
Copy Markdown
Member

Added the parent issue to a release milestone now that there's a patch. Looks good at a glance but I need to do my usual local repro / grok step sometime. Thanks!

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.

3 participants