aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-07-16 14:26:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-07-16 14:27:27 +0300
commite392ff8ef304a78a0701f11fcd0ec27af28a88ac (patch)
treef0c1849f1a0aefeff2ec17139be9a05cd01a2ed1
parentb2a83ba28ef61f5c6aa32f3d81233e95cab1f3b0 (diff)
On Windows increase fdopen() retry timeout on ERROR_SHARING_VIOLATION up to 2 seconds from 1
Also do the same for mventry(), and try_rmfile().
-rw-r--r--libbutl/fdstream.cxx4
-rw-r--r--libbutl/filesystem.cxx8
2 files changed, 6 insertions, 6 deletions
diff --git a/libbutl/fdstream.cxx b/libbutl/fdstream.cxx
index b12ce78..0a5525c 100644
--- a/libbutl/fdstream.cxx
+++ b/libbutl/fdstream.cxx
@@ -1129,9 +1129,9 @@ namespace butl
// sometimes ends up with the EACCES POSIX error which is presumably a
// translation of the ERROR_SHARING_VIOLATION system error returned by the
// underlying CreateFile() function call (see mventry() for details). If
- // that's the case, we will keep trying to open the file for a second.
+ // that's the case, we will keep trying to open the file for two seconds.
//
- for (size_t i (0); i < 11; ++i)
+ for (size_t i (0); i < 21; ++i)
{
// Sleep 100 milliseconds before the open retry.
//
diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx
index f145ee7..941be10 100644
--- a/libbutl/filesystem.cxx
+++ b/libbutl/filesystem.cxx
@@ -1085,9 +1085,9 @@ namespace butl
//
// And also there are some unknown reasons for the 'permission denied'
// failure (see mventry() for details). If that's the case, we will keep
- // trying to move the file for a second.
+ // trying to move the file for two seconds.
//
- for (size_t i (0); i < 11; ++i)
+ for (size_t i (0); i < 21; ++i)
{
// Sleep 100 milliseconds before the removal retry.
//
@@ -1721,7 +1721,7 @@ namespace butl
// For reasons unknown an attempt to move a file sometimes ends up with
// the 'file is being used by another process' error. If that's the case,
- // we will keep trying to move the file for a second.
+ // we will keep trying to move the file for two second.
//
// The thinking is that there can be some Windows process analyzing newly
// created files and so preventing their move, removal, or change.
@@ -1730,7 +1730,7 @@ namespace butl
// fdopen().
//
DWORD ec;
- for (size_t i (0); i < 11; ++i)
+ for (size_t i (0); i < 21; ++i)
{
// Sleep 100 milliseconds before the move retry.
//