On Fri, Feb 19, 2016 at 02:07:36PM -0800, Peter Pentchev via RT wrote: > The problem is that when your SSH client decides to start the mux > process, the latter *does not close* its standard error stream; > it keeps file descriptor 2 open to whatever the original SSH client > had it open to - usually this is the user's terminal, but in your > case, it's the pipe back to your program. Even though the original > SSH client process exited, the pipe is still open (to another process, > yet still open anyway), and Perl is absolutely correct to wait for > everything that has the pipe open to close it. This does not even > come from Perl, it's your OS's kernel doing it - but, since there is > a process still using the pipe, it's correct to do it that way :( > > As far as I can see, this behavior - leaving fd 2 open to the original > client's standard error stream - is not explicitly documented in > either the ssh(1) manual page or the ssh_config(5) one. I've even > tried passing the -E option to send the debug logs to someplace else, > but it does indeed only affect the debug logs, not the actual standard > error stream :(
Hello Peter, Thank you for this detailed analysis! I saw the open file descriptor in the debug log but didn't think that it could be the reason for the delay. > I wonder if it might be worthwhile to raise this with the OpenSSH > developers; I could do that if you'd like me to. If you'd like to that would be great. Thank you for your quick help. Regards Simon -- + privacy is necessary + using gnupg http://gnupg.org + public key id: 0x92FEFDB7E44C32F9
signature.asc
Description: PGP signature