Skip to content

make open/unlink failures user friendly on windows using retry/abort

Heiko Voigt git 4 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 7 repliesIn review
  2. v3 posting 2/23 of 8 patches 10 repliesSuperseded
  3. v3 posting 1/22 of 5 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v24 patches3 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mingw: move unlink wrapper to mingw.ccompat/mingw.c compat/mingw.h+11 -81 reply
2/5mingw: work around irregular failures of unlink on windowscompat/mingw.c+29 -20 replies
2/5mingw: work around irregular failures of unlink on windowscompat/mingw.c+29 -20 replies
3/5mingw: make failures to unlink or move raise a questioncompat/mingw.c+78 -00 replies
4/5mingw: add fallback for rmdir in case directory is in usecompat/mingw.c compat/mingw.h+28 -00 replies
5/5mingw_rmdir: set errno=ENOTEMPTY when appropriatecompat/mingw.c+28 -05 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/5] make open/unlink failures user friendly on windows using retry/abort

This is the fourth iteration of my patch series with hopefully all the mentioned issues addressed.

Quoted 6 lines · Junio C Hamano
Quoted 3 lines · Erik Faye-Lund

Perhaps instead we would be better of with something like an xunlink (etc) in wrapper.c that deals with this on all platforms (and make sure that unlink sets errno to EBUSY correctly if it doesn't already)?

Quoted 7 lines

That is superficially similar to the way we let xread() silently handle short read to give us an easier to use API. Especially, the part to silently retry for a few times is similar to xread() recovering by repeating short reads.

I do not think "ask the user one last time" part belongs to such a wrapper, though.

I think we should currently keep this Windows specific because this is the only system where such problems occur in practise. If we find later on that other systems are affected with the same problem we can still move the functions to another more public place. But without proper testing whether it helps on other setups as well putting this into a more prominent place does not make sense, IMO.

Cheers Heiko

Heiko Voigt (4):
mingw: move unlink wrapper to mingw.c
mingw: work around irregular failures of unlink on windows
mingw: make failures to unlink or move raise a question
mingw: add fallback for rmdir in case directory is in use

Johannes Schindelin (1):
mingw_rmdir: set errno=ENOTEMPTY when appropriate

 compat/mingw.c |  168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 compat/mingw.h |   14 ++---
 2 files changed, 173 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.4.34.gd2cb1