diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | src/zenstore/blockstore.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ab62e9bc8..26acdb172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ ## + - Bugfix: Fixed invalid namespace+bucket regexes in BuildStore (only fired with new MSVC compiler) - Bugfix: `GcScheduler` could delay shutdown in some situations - Bugfix: On exit, trace shutdown can happen before all threads completed their TLS cleanup - Bugfix: When requesting a value via the GetCacheChunks rpc method, if the request specified a raw hash, only return a hit if the raw hash matches what was in the cache +- Bugfix: Flush of blockstore file could sometimes cause an error due to a race condition ## 5.7.2 - Feature: Added `--force` option to `zen builds download` command that forces download of all content ignoring any local state diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index b8fa03305..ec7924553 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -171,9 +171,9 @@ BlockStoreFile::Flush(uint64_t FinalSize) if (FinalSize != (uint64_t)-1) { uint64_t ExpectedSize = 0; - if (!m_CachedFileSize.compare_exchange_weak(ExpectedSize, FinalSize)) + while (!m_CachedFileSize.compare_exchange_weak(ExpectedSize, FinalSize)) { - ZEN_ASSERT(m_CachedFileSize.load() == FinalSize); + ZEN_ASSERT(ExpectedSize <= FinalSize); } } } |