Skip to content
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

synced_folders/rsync: SSH control for faster rsync #6568

Merged
merged 1 commit into from
Nov 20, 2015
Merged

Conversation

mitchellh
Copy link
Contributor

Fixes #6399

This uses OpenSSH control paths for a faster rsync. On my system where rsync was already fairly fast, it went from ~250ms on every invocation to ~175ms. I've heard on some systems executing rsync is hundreds more ms, so this should speed up even more.

mitchellh added a commit that referenced this pull request Nov 20, 2015
synced_folders/rsync: SSH control for faster rsync
@mitchellh mitchellh merged commit 6e6172e into master Nov 20, 2015
@mitchellh mitchellh deleted the b-faster-rsync branch November 20, 2015 18:50
@mkuzmin
Copy link
Contributor

mkuzmin commented Nov 22, 2015

This change broke synchronization from Windows hosts.

C:\Users\michael.kuzmin\Projects\forks\vagrant>bundle exec vagrant rsync
==> teamcity: Rsyncing folder: /c/Users/michael.kuzmin/Projects/forks/vagrant/tasks/ => /vagrant
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /c/Users/michael.kuzmin/Projects/forks/vagrant/tasks/
Guest path: /vagrant
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path
sudo rsync -e ssh -p 22 -o ControlMaster=auto -o ControlPath=C:/Users/MICHAE~1.KUZ/AppData/Local/Temp/ssh.386 -o ControlPersist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'C:/Users/michael.kuzmin/Projects/forks/vagrant/.vagrant/machines/teamcity/vsphere/private_key' --exclude .vagrant/ /c/Users/michael.kuzmin/Projects/forks/vagrant/tasks/ jetbrains@172.20.160.27:/vagrant

Warning: Permanently added '172.20.160.27' (ECDSA) to the list of known hosts.
mm_receive_fd: no message header
process_mux_new_session: failed to receive fd 0 from slave
mux_client_request_session: read from master failed: Connection reset by peer
Failed to connect to new control master
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

ControlPath is resolved to C:/Users/MICHAE~1.KUZ/AppData/Local/Temp/ssh.386 instead of /c/Users/michael.kuzmin/AppData/Local/Temp/ssh.386

@mkuzmin
Copy link
Contributor

mkuzmin commented Nov 25, 2015

It's a kind of bug in Windows, but that's a common behavior in several Windows versions.
Dir.tmpdir() is resolved to %TEMP%, TEMP depends from USERPROFILE
image
If username is longer than 8 symbols, Windows resolves it to such value in Windows 95 style.

> set
TEMP=C:\Users\MICHAE~1.KUZ\AppData\Local\Temp
TMP=C:\Users\MICHAE~1.KUZ\AppData\Local\Temp
USERPROFILE=C:\Users\michael.kuzmin

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Low-latency rsync-auto
2 participants