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.
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.
Patch applied. This will be in OpenSSH 7.6
Close all resolved bugs after release of OpenSSH 7.7.