aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-02-28 11:10:34 +0100
committerGitHub <[email protected]>2024-02-28 11:10:34 +0100
commitbd3b270b57eafc626ca42efea3be8c460761c6ca (patch)
treebea450cfeb1c0f092d143e2f3283c65fe432617d /src/zenstore/cas.cpp
parentadd disk caching to block move (#661) (diff)
downloadzen-bd3b270b57eafc626ca42efea3be8c460761c6ca.tar.xz
zen-bd3b270b57eafc626ca42efea3be8c460761c6ca.zip
Make sure we wait for all scheduled tasks to complete before throwing exceptions further (#662)
Bugfix: We must not throw exceptions to calling function until all async work we spawned has returned
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index b20f2049a..f1a141ca0 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -119,6 +119,13 @@ CasImpl::Initialize(const CidStoreConfiguration& InConfig)
}}));
for (std::future<void>& Result : Work)
{
+ if (Result.valid())
+ {
+ Result.wait();
+ }
+ }
+ for (std::future<void>& Result : Work)
+ {
Result.get();
}
}