Autopack fails with err 17 "File Exists" on windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Bazaar 1.9
Committing to a bound heavyweight checkout situated in a rich-root-pack repo, bound to a server branch in a rich-root-pack no-trees repo
Local repo is d:\workspace
Network repo is y:\repository
On autopack client returns
File exists: u'Y:/repository
Log reports
3113.989 Auto-packing repository <bzrlib.
The error is NOT reported in the log.
Manually packing repository :-
bzr pack y:\repository
Resolves this with no error.
Possible avenues of exlporation
- opportunistic locks (on or off)
- dangling file handles
? Who knows.
Changed in bzr: | |
status: | New → Fix Released |
So a question, are you directly bound to the Y:/ repository, or are you bound somehow through bzr+ssh:// or bzr://?
With bzr 1.9 as the client and server, I believe it will send an RPC request to do the auto-pack, rather than doing it from the client. Which would explain how you could see the error (for bzr+ssh it would be triggered by the remote bzr, and then shown via the ssh stderr connection), but it wouldn't be in the local log file, because it was actually written to the server's log file.
Then again, if that was happening, I wouldn't expect it to say "Y:/..." and I wouldn't expect to see the "Auto-packing ...." in the log file.
On windows, there can be some odd results if the process dies without flushing its files. Things seem to be buffered in userspace, so if you don't do ".flush()" it never actually writes anything to disk. (I believe on Linux the buffering is in kernel space, so when the process dies, the kernel does the final flush to disk.)
I will say that regardless, 3000s for an operation before it decides to auto-pack seems rather long.
Anyway, back to the bug. I would guess this is a dangling file handle which is triggered in the autopack code and not in the regular "pack" code (they share the bulk of the code, but it could be something outside of the actual packing.)
Alternatively, if it took 3000s to get to this point, is it possible that you were racing with some other user who pushed into the same repository? And then you are actually racing between 2 processes that are both trying to open/re-write the file?