From bcpierce at seas.upenn.edu Wed Jul 2 10:06:12 2008 From: bcpierce at seas.upenn.edu (Benjamin C. Pierce) Date: Wed, 2 Jul 2008 10:06:12 -0400 Subject: [Unison-hackers] [unison-svn] r302 - trunk/src Message-ID: <200807021406.m62E6CIo003790@yaws.seas.upenn.edu> Author: bcpierce Date: 2008-07-02 10:06:09 -0400 (Wed, 02 Jul 2008) New Revision: 302 Modified: trunk/src/RECENTNEWS trunk/src/TODO.txt trunk/src/copy.ml trunk/src/mkProjectInfo.ml trunk/src/os.ml trunk/src/update.ml Log: * Fixed a couple of file-transfer bugs. (One was about copying resource forks. Another was about restarting interrupted transfers on files where exactly zero bytes had been transferred so far and the file had been created with null permissions -- believe it or not, this is possible with rsync!) This required a protocol change, so I'm also bumping the version number. Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/RECENTNEWS 2008-07-02 14:06:09 UTC (rev 302) @@ -1,3 +1,13 @@ +CHANGES FROM VERSION 2.31.-1 + +* Fixed a couple of file-transfer bugs. (One was about copying + resource forks. Another was about restarting interrupted transfers + on files where exactly zero bytes had been transferred so far and + the file had been created with null permissions -- believe it or + not, this is possible with rsync!) This required a protocol change, + so I'm also bumping the version number. + +------------------------------- CHANGES FROM VERSION 2.30.4 * Work on text UI to prepare for new filesystem watcher functionality Modified: trunk/src/TODO.txt =================================================================== --- trunk/src/TODO.txt 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/TODO.txt 2008-07-02 14:06:09 UTC (rev 302) @@ -13,8 +13,6 @@ * Makefile for fstest -* Reverse CheckNonemptyAndMakeWriteable - * Work on the Unison side - create temp file - start watcher based on watcherosx switch, passing all paths as args @@ -30,7 +28,7 @@ scratch if necessary * See if there are other hacks that should be propagated to 2.27 (the - directory transfer throttle for sure!) + directory transfer throttle for sure!), and Jerome's recent suggested fix ########################################################################### Modified: trunk/src/copy.ml =================================================================== --- trunk/src/copy.ml 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/copy.ml 2008-07-02 14:06:09 UTC (rev 302) @@ -316,10 +316,11 @@ let reallyTransferFile connFrom fspathFrom pathFrom fspathTo pathTo realPathTo update desc ressLength ressOnly id = - debug (fun() -> Util.msg "reallyTransferFile(%s,%s) -> (%s,%s,%s,%s)\n" + debug (fun() -> Util.msg "reallyTransferFile(%s,%s) -> (%s,%s,%s,%s)%s\n" (Fspath.toString fspathFrom) (Path.toString pathFrom) (Fspath.toString fspathTo) (Path.toString pathTo) - (Path.toString realPathTo) (Props.toString desc)); + (Path.toString realPathTo) (Props.toString desc) + (if ressOnly then " (ONLY RESOURCE FORK)" else "")); let srcFileSize = Props.length desc in let file_id = Remote.newMsgId () in @@ -547,20 +548,23 @@ let targetExists checkSize fspathTo pathTo = Os.exists fspathTo pathTo && (match checkSize with - `CheckNonemptyAndMakeWriteable -> + `MakeWriteableAndCheckNonempty -> + let n = Fspath.concatToString fspathTo pathTo in + let perms = (Unix.stat n).Unix.st_perm in + let perms' = perms lor 0o600 in + Unix.chmod n perms'; let r = Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc > Uutil.Filesize.zero in - if r then begin - let n = Fspath.concatToString fspathTo pathTo in - let perms = (Unix.stat n).Unix.st_perm in - let perms' = perms lor 0o600 in - Unix.chmod n perms' - end; r - | `CheckSize desc -> - Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc - = Props.length desc) + | `CheckDataSize desc -> + Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc + = Props.length desc + | `CheckSize (desc,ress) -> + Props.length (Fileinfo.get false fspathTo pathTo).Fileinfo.desc + = Props.length desc + && Osx.ressLength (Osx.getFileInfos fspathTo pathTo `FILE).Osx.ressInfo + = Osx.ressLength ress) let targetExistsLocal connFrom (checkSize, fspathTo, pathTo) = Lwt.return (targetExists checkSize fspathTo pathTo) @@ -598,7 +602,7 @@ else begin Uutil.showProgress id Uutil.Filesize.zero "ext"; targetExistsOnRoot - rootTo rootFrom (`CheckNonemptyAndMakeWriteable, fspathTo, pathTo) >>= (fun b -> + rootTo rootFrom (`MakeWriteableAndCheckNonempty, fspathTo, pathTo) >>= (fun b -> let prog = if b then Prefs.read copyprogrest @@ -621,11 +625,13 @@ ^ (Os.quotes toSpec) in Trace.log (Printf.sprintf "%s\n" cmd); let _,log = Os.runExternalProgram cmd in - debug (fun() -> Util.msg - "transferFileUsingExternalCopyprog: returned\n------\n%s\n-----\n" - (Util.trimWhitespace log)); + debug (fun() -> + let l = Util.trimWhitespace log in + Util.msg "transferFileUsingExternalCopyprog %s: returned...\n%s%s" + (Path.toString pathFrom) + l (if l="" then "" else "\n")); targetExistsOnRoot - rootTo rootFrom (`CheckSize desc, fspathTo, pathTo) + rootTo rootFrom (`CheckDataSize desc, fspathTo, pathTo) >>= (fun b -> if not b then raise (Util.Transient (Printf.sprintf @@ -653,7 +659,7 @@ (* Check whether we actually need to copy the file (or whether it already exists from some interrupted previous transfer) *) targetExistsOnRoot - rootTo rootFrom (`CheckSize desc, fspathTo, pathTo) >>= (fun b -> + rootTo rootFrom (`CheckSize (desc,ress), fspathTo, pathTo) >>= (fun b -> if b then begin Util.msg "%s/%s has already been transferred\n" (Fspath.toString fspathTo) (Path.toString pathTo); @@ -663,9 +669,9 @@ end else if Prefs.read copyprog <> "" && Prefs.read copythreshold >= 0 - && Props.length desc >= Uutil.Filesize.ofInt64 (Int64.mul - (Int64.of_int 1000) - (Int64.of_int (Prefs.read copythreshold))) + && Props.length desc >= Uutil.Filesize.ofInt64 + (Int64.mul (Int64.of_int 1000) + (Int64.of_int (Prefs.read copythreshold))) && update = `Copy then begin (* First use the external program to copy the data fork *) @@ -674,13 +680,13 @@ update desc fp ress id >>= (fun () -> (* Now use the regular transport mechanism to copy the resource fork *) - begin if (Osx.ressLength ress) > Uutil.Filesize.zero then + begin if (Osx.ressLength ress) > Uutil.Filesize.zero then begin transferFile rootFrom pathFrom rootTo fspathTo pathTo realPathTo update desc fp ress true id - else Lwt.return () + end else Lwt.return () end >>= (fun() -> - (* Finally, initialize the file info *) + (* Finally, set the file info *) setFileinfoOnRoot rootTo rootFrom (fspathTo, pathTo, desc))) end else (* Just transfer the file in the usual way with Unison's Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/mkProjectInfo.ml 2008-07-02 14:06:09 UTC (rev 302) @@ -5,8 +5,8 @@ let projectName = "unison" let majorVersion = 2 -let minorVersion = 30 -let pointVersionOrigin = 294 (* Revision that corresponds to point version 0 *) +let minorVersion = 31 +let pointVersionOrigin = 301 (* Revision that corresponds to point version 0 *) (* Documentation: This is a program to construct a version of the form Major.Minor.Point, @@ -86,3 +86,4 @@ + Modified: trunk/src/os.ml =================================================================== --- trunk/src/os.ml 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/os.ml 2008-07-02 14:06:09 UTC (rev 302) @@ -404,7 +404,6 @@ "") in (returnValue,mergeResultLog) end else Lwt_unix.run ( - debug (fun()-> Util.msg "Executing external program unix-style\n"); Lwt_unix.open_process_full cmd (Unix.environment ()) >>= (fun (out, ipt, err) -> readChannelsTillEof [out;err] Modified: trunk/src/update.ml =================================================================== --- trunk/src/update.ml 2008-06-28 14:19:29 UTC (rev 301) +++ trunk/src/update.ml 2008-07-02 14:06:09 UTC (rev 302) @@ -1742,7 +1742,7 @@ let dig' = Os.fingerprint fspath path info in let ress' = Osx.stamp info.Fileinfo.osX in if dig' <> dig then begin - if deleteBadTempFiles then Os.delete fspath path; +(* if deleteBadTempFiles then Os.delete fspath path; *) raise (Util.Transient (Printf.sprintf "The file %s was incorrectly transferred (fingerprint mismatch in %s)%s" (Path.toString path) From bcpierce at seas.upenn.edu Thu Jul 3 13:42:28 2008 From: bcpierce at seas.upenn.edu (Benjamin C. Pierce) Date: Thu, 3 Jul 2008 13:42:28 -0400 Subject: [Unison-hackers] [unison-svn] r303 - trunk/src Message-ID: <200807031742.m63HgSru031618@yaws.seas.upenn.edu> Author: bcpierce Date: 2008-07-03 13:42:21 -0400 (Thu, 03 Jul 2008) New Revision: 303 Modified: trunk/src/RECENTNEWS trunk/src/copy.ml trunk/src/mkProjectInfo.ml Log: * Fixed a small bug with resuming interrupted file transfers when both replicas are local. Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2008-07-02 14:06:09 UTC (rev 302) +++ trunk/src/RECENTNEWS 2008-07-03 17:42:21 UTC (rev 303) @@ -1,3 +1,8 @@ +CHANGES FROM VERSION 2.31.1 + +* Fixed a small bug with resuming interrupted file transfers when both + replicas are local. +------------------------------- CHANGES FROM VERSION 2.31.-1 * Fixed a couple of file-transfer bugs. (One was about copying Modified: trunk/src/copy.ml =================================================================== --- trunk/src/copy.ml 2008-07-02 14:06:09 UTC (rev 302) +++ trunk/src/copy.ml 2008-07-03 17:42:21 UTC (rev 303) @@ -72,6 +72,7 @@ (Fspath.toString fspathTo) (Path.toString pathTo)); let inFd = openFileIn fspathFrom pathFrom `DATA in protect (fun () -> + Os.delete fspathTo pathTo; let outFd = openFileOut fspathTo pathTo `DATA in protect (fun () -> Uutil.readWrite inFd outFd Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2008-07-02 14:06:09 UTC (rev 302) +++ trunk/src/mkProjectInfo.ml 2008-07-03 17:42:21 UTC (rev 303) @@ -87,3 +87,4 @@ + From bcpierce at seas.upenn.edu Sat Jul 5 13:43:35 2008 From: bcpierce at seas.upenn.edu (Benjamin C. Pierce) Date: Sat, 5 Jul 2008 13:43:35 -0400 Subject: [Unison-hackers] [unison-svn] r304 - trunk/src Message-ID: <200807051743.m65HhZQU006018@yaws.seas.upenn.edu> Author: bcpierce Date: 2008-07-05 13:43:33 -0400 (Sat, 05 Jul 2008) New Revision: 304 Modified: trunk/src/RECENTNEWS trunk/src/mkProjectInfo.ml trunk/src/update.ml Log: * Added a bit of debugging code for Alan. Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2008-07-03 17:42:21 UTC (rev 303) +++ trunk/src/RECENTNEWS 2008-07-05 17:43:33 UTC (rev 304) @@ -1,3 +1,8 @@ +CHANGES FROM VERSION 2.31.2 + +* Added a bit of debugging code for Alan. + +------------------------------- CHANGES FROM VERSION 2.31.1 * Fixed a small bug with resuming interrupted file transfers when both Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2008-07-03 17:42:21 UTC (rev 303) +++ trunk/src/mkProjectInfo.ml 2008-07-05 17:43:33 UTC (rev 304) @@ -88,3 +88,4 @@ + Modified: trunk/src/update.ml =================================================================== --- trunk/src/update.ml 2008-07-03 17:42:21 UTC (rev 303) +++ trunk/src/update.ml 2008-07-05 17:43:33 UTC (rev 304) @@ -1522,6 +1522,10 @@ let findUpdates () : Common.updateItem list Common.oneperpath = (* TODO: We should filter the paths to remove duplicates (including prefixes) and ignored paths *) +(* FIX: The following line can be deleted -- it's just for debugging *) +debug (fun() -> Util.msg "Running bogus external program\n"); +let _ = Os.runExternalProgram "dir" in +debug (fun() -> Util.msg "Finished running bogus external program\n"); findUpdatesOnPaths (Prefs.read Globals.paths) From ggg at cs.nott.ac.uk Wed Jul 9 21:45:48 2008 From: ggg at cs.nott.ac.uk (George Giorgidze) Date: Thu, 10 Jul 2008 02:45:48 +0100 Subject: [Unison-hackers] Unison binary for SunOS SPARC Message-ID: Hi, I have just build unison binaries for SunOS SPARC. > uname -a > SunOS 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-280R Just in case if anyone is interested I am making them available for download. http://www.cs.nott.ac.uk/~ggg/files/unison-sparc.tar.gz This includes binaries for 2.27.57 and 2.13.16 versions. I will be putting new versions (if released) in the same tar.gz archive. Cheers, George -- George Giorgidze http://www.cs.nott.ac.uk/~ggg/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20080709/395a6c73/attachment.htm From alan.schmitt at polytechnique.org Fri Jul 11 11:07:12 2008 From: alan.schmitt at polytechnique.org (Alan Schmitt) Date: Fri, 11 Jul 2008 17:07:12 +0200 Subject: [Unison-hackers] Call for help for a strange bug: socket mode, cygwin, and rsync Message-ID: <4FA8AD66-6EF6-4A5F-8347-47ADD7177A75@polytechnique.org> 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