aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/filecas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/filecas.cpp')
-rw-r--r--src/zenstore/filecas.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index 1c6aa539a..b3cdafd4e 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -852,15 +852,25 @@ FileCasStrategy::IterateChunks(std::span<IoHash> ChunkHashes,
if (OptionalWorkerPool)
{
WorkLatch.AddCount(1);
- OptionalWorkerPool->ScheduleWork([&WorkLatch, &ProcessOne, ChunkIndex, &Continue]() {
+ OptionalWorkerPool->ScheduleWork([this, &WorkLatch, &ProcessOne, &ChunkHashes, ChunkIndex, &Continue]() {
auto _ = MakeGuard([&WorkLatch]() { WorkLatch.CountDown(); });
if (!Continue)
{
return;
}
- if (!ProcessOne(ChunkIndex))
+ try
{
- Continue = false;
+ if (!ProcessOne(ChunkIndex))
+ {
+ Continue = false;
+ }
+ }
+ catch (const std::exception& Ex)
+ {
+ ZEN_WARN("Failed iterating chunks for cas root path {}, chunk {}. Reason: '{}'",
+ m_RootDirectory,
+ ChunkHashes[ChunkIndex],
+ Ex.what());
}
});
}