-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
az ssh hangs for duration of ControlPersist if ControlPersist option is set. #7285
Comments
Thank you for opening this issue, we will look into it. |
Isn't this a working expected behaviour?
|
@konstruktoid, it's expected that the background master connection will remain open for the specified time, not that the ssh command itself will hang for the duration. |
@daviewales, yeah you're absolutely correct. |
Does this happen only when you try to connect using the az ssh command, or does the same behavior happen any time you try to connect to that target using ssh? Also, what are the operating systems in the target and the client machines? |
~$ time ssh [email protected] -p2222 -i [...] -o ControlMaster=auto -o ControlPath=/tmp/control -o ControlPersist=60s exit
real 0m0.020s
user 0m0.009s
sys 0m0.006s |
@vthiebaut10, It's the With ❯ time az ssh vm --ip 1.2.3.4 -- -o ControlMaster=auto -o ControlPath=/tmp/controlpath -o ControlPersist=60s exit
OpenSSH_8.9p1 Ubuntu-3ubuntu0.6, OpenSSL 3.0.2 15 Mar 2022
Transferred: sent 5604, received 4588 bytes, in 60.7 seconds
Bytes per second: sent 92.3, received 75.6
az ssh vm --ip 1.2.3.4 -- -o ControlMaster=auto -o -o ControlPersist=60s 0.99s user 0.10s system 1% cpu 1:03.28 total With regular ❯ time ssh -o ControlMaster=auto -o ControlPath=/tmp/control -o ControlPersist=60s [email protected]@1.2.3.4 exit
ssh -o ControlMaster=auto -o ControlPath=/tmp/control -o ControlPersist=60s 0.00s user 0.00s system 1% cpu 0.201 total |
Describe the bug
If
az ssh
is called with the ssh ControlPersist options, it hangs for specified duration of ControlPersist.For example, the following takes 2.8 seconds:
az ssh vm --ip 1.2.3.4 -- exit
While this takes 63.3 seconds.
az ssh vm --ip 1.2.3.4 -- -o ControlMaster=auto -o ControlPath=/home/example/controlpath -o ControlPersist=60s exit
Related command
az ssh vm
Errors
No error.
Issue script & Debug output
Expected behavior
I expect ssh to not hang for the duration of
ControlPersist
.Environment Summary
Additional context
I'm trying to use
az ssh
with Ansible. I have created a wrapper script, but have noticed I need to exclude the Control* arguments if I want good performance.The text was updated successfully, but these errors were encountered: