Bug 2707 - mux_client_hello_exchange: write packet: Broken pipe when timeout is about to expire
Summary: mux_client_hello_exchange: write packet: Broken pipe when timeout is about to...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.4p1
Hardware: Other Linux
: P5 normal
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_7_6
  Show dependency treegraph
 
Reported: 2017-04-08 02:25 AEST by Strahinja Kustudic
Modified: 2018-04-06 12:26 AEST (History)
2 users (show)

See Also:


Attachments
don't fatal on mux establishment errors (1.50 KB, patch)
2017-06-02 15:11 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Strahinja Kustudic 2017-04-08 02:25:10 AEST
When ControlMaster and ControlPersist are used the ssh client will sometimes throw a 'mux_client_hello_exchange: write packet: Broken pipe' error when it tries to connect to the socket which is just about to expire.

This issue is very hard to reproduce, I noticed it while I was working with Ansible with a lot of hosts. To reproduce it you have to:

1. Enable ControlMaster and set ControlPersist=60,
2. Then try to connect to a lot of hosts (100+ in my test case),
3. Wait about 55-58 seconds and then try to connect again.

Out of 100 hosts, on about 2-10 hosts (depending on the case) Ansible will fail to connect over ssh with ssh returning the error mentioned above. Here is the link to the issue in Ansible https://github.com/ansible/ansible/issues/16731 which has a playbook which can reproduce this bug. This issue should be resolved in Ansible version 2.4 when it's released, but this is still an issue with the SSH client, and not Ansible.

It's like there is some race condition with the ControlPersist socket expiring and being reused by ssh.
Comment 1 Damien Miller 2017-06-02 15:11:30 AEST
Created attachment 2987 [details]
don't fatal on mux establishment errors

We already fall back from some errors in the mux setup path. This patch extends this to falling back for errors while writing to the mux master and protocol negotiation failures.
Comment 2 Damien Miller 2017-06-09 16:47:29 AEST
Patch applied. This will be in OpenSSH 7.6
Comment 3 Damien Miller 2018-04-06 12:26:45 AEST
Close all resolved bugs after release of OpenSSH 7.7.