Each SSH connection throughout every playbook execution ends with Broken Pipe error message mux_client_read_packet: read header failed: Broken pipe, seen with verbose logging enabled. This doesn’t cause the failure of a task and the connection can still be seen to return a 0 exit code and the playbook executes successfully. I’m not getting any performance improvements with pipelining enabled and I am curious if this would have a performance impact on ControlPersist and pipelining if connections are terminating like this?
Each SSH connection throughout every playbook execution ends with
Broken Pipe error message `mux_client_read_packet: read header failed:
Broken pipe`, seen with verbose logging enabled. This doesn't cause the
failure of a task and the connection can still be seen to return a 0
exit code and the playbook executes successfully. I'm not getting any
performance improvements with pipelining enabled and I am curious if
this would have a performance impact on ControlPersist and pipelining
if connections are terminating like this?
I’m investigating a bit further, I see the SSH command that ansible is executing (look for the line starting with “SSH: EXEC”, and I try running that in isolation:
Then the shell will hang waiting for you to enter a python command (it’s running /usr/bin/python3). you can type print(“hello”) to see this - it prints “hello”.
print(‘hello’)
^D (eof)
hello
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 0
If I run this in multiple terminals, I can see that the error “debug3: mux_client_read_packet: read header failed: Broken pipe” is an error being printed by SSH, not by ansible itself.
It also appears that SSH is actually reusing the multiplexed connection - if I run this command from multiple terminals, the first terminal shows status messages about the connection for the other terminals.
I tried taking a packet capture with Wireshark just to be double-sure that Ansible was reusing the same connection, and Ansible was.
I ran wireshark, limited capture to “tcp.port == 22”, and then went to Menu → Statistics → Conversations → TCP, and I observe only one long-lived TCP SSH connection per host.
Which is to say, I don’t think this “broken pipe” error is breaking connection pooling.