diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-19 15:42:04 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-19 15:42:04 +0200 |
| commit | 80178a5bc219eefd5e223a916a6aeb16fee358ca (patch) | |
| tree | 73ce9390ccaa6309be19396b6c96fca616e1215a | |
| parent | Merge pull request #98 from EpicGames/de/fix-bucket-name-rules (diff) | |
| download | zen-80178a5bc219eefd5e223a916a6aeb16fee358ca.tar.xz zen-80178a5bc219eefd5e223a916a6aeb16fee358ca.zip | |
Fix and retry count and add an extra iteration to give more time for success
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index 6b7b73dcf..4edc13b4a 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -1769,7 +1769,7 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c // We retry to move the file since it can be held open for read. // This happens if the server processes a Get request for the file or // if we are busy sending the file upstream - int RetryCount = 3; + int RetryCount = 4; do { Ec.clear(); @@ -1789,7 +1789,8 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c if (!ExistingEc && (OldFileSize == NewFileSize)) { ZEN_INFO( - "Failed to move temporary file '{}' to '{}'. Target file has same size, assuming concurrent write of same value, " + "Failed to move temporary file '{}' to '{}' for '{}'. Target file has same size, assuming concurrent write of same " + "value, " "move " "failed with reason '{}'", DataFile.GetPath(), @@ -1865,9 +1866,8 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c Ec.message()); // Semi arbitrary back-off - zen::Sleep(200 * (4 - RetryCount)); // Sleep at most for a total of 2 seconds - RetryCount--; - } while (RetryCount > 0); + zen::Sleep(200 * (5 - RetryCount)); // Sleep at most for a total of 3 seconds + } while (RetryCount-- > 0); throw std::system_error(Ec, fmt::format("Failed to finalize file '{}' for put in '{}'", DataFilePath.ToUtf8(), m_BucketDir)); } |