aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/workspaces.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-11-28 23:34:00 +0100
committerGitHub Enterprise <[email protected]>2024-11-28 23:34:00 +0100
commitb960d42525ed1239dc32175204171880dc9a5403 (patch)
tree39536dca7f15f943ab4d451946874739f38fe940 /src/zenstore/workspaces.cpp
parentfix oplog index path reading error (#246) (diff)
downloadzen-b960d42525ed1239dc32175204171880dc9a5403.tar.xz
zen-b960d42525ed1239dc32175204171880dc9a5403.zip
make sure we don't throw exception from worker thread (#247)
* Make sure we don't throw exception from worker thread * secure async project flush * secure workspaces * spelling
Diffstat (limited to 'src/zenstore/workspaces.cpp')
-rw-r--r--src/zenstore/workspaces.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/zenstore/workspaces.cpp b/src/zenstore/workspaces.cpp
index d30a27e33..be921552a 100644
--- a/src/zenstore/workspaces.cpp
+++ b/src/zenstore/workspaces.cpp
@@ -302,7 +302,14 @@ namespace {
RootDir = Parent / DirectoryName,
RelativeRoot = RelativeRoot.empty() ? DirectoryName : RelativeRoot / DirectoryName]() {
auto _ = MakeGuard([DataPtr]() { DataPtr->WorkLatch.CountDown(); });
- DataPtr->Traverse(RelativeRoot, RootDir);
+ try
+ {
+ DataPtr->Traverse(RelativeRoot, RootDir);
+ }
+ catch (const std::exception& Ex)
+ {
+ ZEN_WARN("Exception while traversing path {} {}: {}", RelativeRoot, RootDir, Ex.what());
+ }
});
return false;
}
@@ -632,8 +639,15 @@ Workspaces::GetWorkspaceShareChunks(const Oid& WorkspaceId,
{
WorkLatch.AddCount(1);
WorkerPool.ScheduleWork([&, Index]() {
- auto _ = MakeGuard([&WorkLatch]() { WorkLatch.CountDown(); });
- Chunks[Index] = GetOne(RootPath, *WorkspaceAndShare.second, ChunkRequests[Index]);
+ auto _ = MakeGuard([&WorkLatch]() { WorkLatch.CountDown(); });
+ try
+ {
+ Chunks[Index] = GetOne(RootPath, *WorkspaceAndShare.second, ChunkRequests[Index]);
+ }
+ catch (const std::exception& Ex)
+ {
+ ZEN_WARN("Exception while fetching chunks, chunk {}: {}", ChunkRequests[Index].ChunkId, Ex.what());
+ }
});
}
WorkLatch.CountDown();