[Unison-hackers] Call for help for a strange bug: socket mode, cygwin, and rsync

Alan Schmitt alan.schmitt at polytechnique.org
Fri Jul 11 11:07:12 EDT 2008


Hello,

Benjamin and I have been tracking a very elusive bug that only occurs  
in a very specific situation: running a cygwin version of unison in  
socket mode and using rsync.

More precisely what happens is as follows. We use the recently added  
preference to transfer new files using an external program, more  
precisely rsync. When such a transfer occurs, unison quits right after  
the first rsync transfer (and does not even rename the file from the  
temporary name to its final name). The sequence of events seems to be:
- the transfer occurs
- the server receives an EOF and says that the client has closed the  
connection
	[server: remote+] grab: EOF
	[server: remote] Connection closed by the client
- the client then quits

The previous description is valid for maxthreads=1. For higher values,  
several rsync transfers may be started, but as soon as one completes,  
the connection with the server is severed (other rsync transfers that  
were started complete but the temporary file is not moved to its final  
location).

The code to run the external program is fairly simple (we have two  
versions: for unix or non-unix, both can run on cygwin and both fail,  
here is the non-unix one):
     let c = Unix.open_process_in ("\"" ^ cmd ^ "\"") in
     let log = readChannelTillEof c in
     let returnValue = Unix.close_process_in c in
     let mergeResultLog =
       cmd ^
       (if log <> "" then "\n\n" ^ log else "") ^
       (if returnValue <> Unix.WEXITED 0 then
          "\n\n" ^ Util.process_status_to_string returnValue
        else
          "") in
     (returnValue,mergeResultLog)

The strangest thing is that this bug is very specific, in the sense  
that:
- we cannot reproduce it on OS X
- we cannot reproduce it using ssh connection to unison (instead of  
socket connection)
- we cannot reproduce it using other external programs, such as scp

If anyone has suggestions as to what may be going on, I'd really like  
to understand this.

Thanks a lot,

Alan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20080711/fb9be949/PGP-0001.sig


More information about the Unison-hackers mailing list