{"id":7433,"date":"2014-06-19T03:54:00","date_gmt":"2014-06-19T03:54:00","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/unison-sync-between-windows-linux-hangs-randomly-during-transfer-collection-of-common-programming-errors\/"},"modified":"2014-06-19T03:54:00","modified_gmt":"2014-06-19T03:54:00","slug":"unison-sync-between-windows-linux-hangs-randomly-during-transfer-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/19\/unison-sync-between-windows-linux-hangs-randomly-during-transfer-collection-of-common-programming-errors\/","title":{"rendered":"Unison sync between Windows\/Linux hangs randomly during transfer-Collection of common programming errors"},"content":{"rendered":"<p>We regularly deploy interactive kiosk CPUs to remote phsyical sites, and I&#8217;ve developed a content updater application that performs a nightly sync of media assets between each kiosk (Windows 7 Pro) and a hosted CMS (virtualized Ubuntu server running on linode.com). The content updater is authored in C#\/.NET, and it spawns a child Unison process using Process.Start(). Unison is configured to connect to the remote server via SSH using a private key.<\/p>\n<p>The issue that we&#8217;re hitting is that when spawned as a child process from ContentUpdater.exe, Unison will often simply stop communicating with the remote server during a transfer and hang indefinitely. There&#8217;s no simple repro &#8211; sometimes it works, more often than not it hangs. It seems to be more fragile on larger updates (400MB+) but that&#8217;s more conjecture than anything else. When it does hang, the Unison process on the client (Windows 7) is still showing 25% CPU utilization, and the server also shows the unison process running as well &#8212; there&#8217;s just no network activity. I know it&#8217;s connecting, because it always starts the process and gets partway through the transfer, but it never hangs in the same place twice. I&#8217;m running a native Windows binary build of Unison-2.40.63.exe, and the same version of unison on the remote server.<\/p>\n<p>The Unison command line on Windows looks like:<\/p>\n<pre><code>Unison-2.40.63.exe -contactquietly -silent -batch -sshcmd \"C:\\KioskManagement\\Apps\\ssh2plink.bat\" -sshargs \"-p 22 -i C:\\cygwin\\home\\someuser\\.ssh\\contentupdater-rsync-key.ppk\" -ignore \"Path {innovations,todaytomorrow,scale,mooreslaw,brilliantminds,askafab}\" ssh:\/\/cmsuser@server\/\/home\/cms\/base-preview\/webapps\/ROOT\/applications C:\\kioskdir\\temp\\applications -force ssh:\/\/cmsuser@server\/\/home\/cms\/base-preview\/webapps\/ROOT\/applications\n<\/code><\/pre>\n<p>For the record, I had originally authored the content updater to use rsync (via cygwin on Windows), but was hitting the same issues. To see if the ssh transport was part of the problem, I tried using rsync in server mode (rsyncd) but the hanging continued to rear its head.<\/p>\n<p>At this point, I&#8217;m thoroughly stumped. The issue repros on other servers too, so I&#8217;m thinking it&#8217;s on the Windows side of things. I&#8217;m also inclined to believe that the problem only happens when calling Unison\/rsync from Process.Start() inside of another process (UPDATE: I just got it to repro when running from the command line) &#8211; it doesn&#8217;t seem to fail when running directly from the command line. Unison\/rsync also never error out, so there are no logfiles to check (unless somebody knows of some sort of server-side trace or logfile on the remote server I can check &#8212; full disclosure: I&#8217;m a FreeBSD geek, and know precious little about Ubuntu under the hood).<\/p>\n<p>Thanks in advance for any and all insight\/ideas\/solutions!<\/p>\n<p>Best<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We regularly deploy interactive kiosk CPUs to remote phsyical sites, and I&#8217;ve developed a content updater application that performs a nightly sync of media assets between each kiosk (Windows 7 Pro) and a hosted CMS (virtualized Ubuntu server running on linode.com). The content updater is authored in C#\/.NET, and it spawns a child Unison process [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7433","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7433"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7433\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}