ControlPersist 开启时 SSH 冻结

Sta*_*kis 6 linux ssh freeze git

我最近启用ControlMaster并启用ControlPersist了 SSH,以便它重用和多路复用连接以提高速度。配置是:

ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
ControlPersist 4h
Run Code Online (Sandbox Code Playgroud)

如果我ControlPersist关闭,一切都很好。有了它,不过,第一混帐/ HG连接将永远定格。SSH 正常(在 shell 中)运行正常,这是第一次,但 git/hg 冻结。如果我用 ctrl+C 停止它然后重试,它将使用已经建立的连接进行多路复用,它会很快,但它不会第一次这样做。谈到LogLevel多达11给我:

remote: debug2: fd 4 setting O_NONBLOCK
remote: debug1: forking to background
remote: debug1: Entering interactive session.
remote: debug2: set_control_persist_exit_time: schedule exit in 14400 seconds
remote: debug1: multiplexing control connection
remote: debug2: fd 5 setting O_NONBLOCK
Run Code Online (Sandbox Code Playgroud)

在这一点上,它只是冻结并永远留在那里。怎么了?

小智 3

我看到了相同的行为,我认为这是由于这个 OpenSSH bug:https://bugzilla.mindrot.org/show_bug.cgi? id=1988 (ControlPersist 导致 stderr 保持打开状态,直到主连接超时)

希望它最终能得到修复。