aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-05-27 09:32:15 +0200
committerGitHub Enterprise <[email protected]>2024-05-27 09:32:15 +0200
commit0799bb8aeb34f3e68092e8d1a40568227af85aea (patch)
treeb4a2ef1b97a5706489a07f6e99c28ab3fc93eca6
parentrelease 5.4.5 (#80) (diff)
downloadzen-0799bb8aeb34f3e68092e8d1a40568227af85aea.tar.xz
zen-0799bb8aeb34f3e68092e8d1a40568227af85aea.zip
fix iterate chunks crash (#86)
* fix worklatch count in Oplog::IterateChunks
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenserver/projectstore/projectstore.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca22ef99c..4b3314b09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
##
- Bugfix: Don't try to read bytes to validate a compact binary object that is empty
- Bugfix: Don't fake free memory buffer pointer when materializing a zero size file
+- Bugfix: Fix crash when iterating chunks in project store causing crash due threading issues
- Improvement: Asserts gives an immediate ERROR log entry with callstack and reason
- Improvement: Asserts flushes the log before sending error report to Sentry
- Improvement: Refactored IterateChunks to allow reuse in diskcachelayer and hide public GetBlockFile() function in BlockStore
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 45a96c60d..0b7c419ba 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -938,6 +938,7 @@ ProjectStore::Oplog::IterateChunks(std::span<Oid> ChunkIds,
{
break;
}
+ WorkLatch.AddCount(1);
OptionalWorkerPool->ScheduleWork([&WorkLatch, ChunkIndex, &FileChunkIndexes, &FileChunkPaths, &AsyncCallback, &Result]() {
auto _ = MakeGuard([&WorkLatch]() { WorkLatch.CountDown(); });
if (Result.load() == false)