aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-12-10 10:49:38 +0100
committerGitHub Enterprise <[email protected]>2025-12-10 10:49:38 +0100
commit5b256bb1d3ab06581af2643b5472a1f9121d20ee (patch)
tree05350f9e71ff089c1b9091d499eb492732dbca87 /src/zenstore/cache/structuredcachestore.cpp
parentfix buffer memory in builds cache (#682) (diff)
downloadzen-5b256bb1d3ab06581af2643b5472a1f9121d20ee.tar.xz
zen-5b256bb1d3ab06581af2643b5472a1f9121d20ee.zip
remove catching of exceptions in batch operations now that they are not executed in the destructor (#683)
don't call WriteChunks in batch operation if no chunks needs to be written
Diffstat (limited to 'src/zenstore/cache/structuredcachestore.cpp')
-rw-r--r--src/zenstore/cache/structuredcachestore.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/zenstore/cache/structuredcachestore.cpp b/src/zenstore/cache/structuredcachestore.cpp
index f1cf6e4a4..54c9674de 100644
--- a/src/zenstore/cache/structuredcachestore.cpp
+++ b/src/zenstore/cache/structuredcachestore.cpp
@@ -159,16 +159,9 @@ ZenCacheNamespace::CommitPutBatch(PutBatchHandle* Batch)
void
ZenCacheNamespace::DeletePutBatch(PutBatchHandle* Batch) noexcept
{
- try
- {
- ZEN_ASSERT(Batch);
- m_DiskLayer.DeletePutBatch(Batch->DiskLayerHandle);
- delete Batch;
- }
- catch (const std::exception& Ex)
- {
- ZEN_ERROR("Exception in ZenCacheNamespace::DeletePutBatch: '{}'", Ex.what());
- }
+ ZEN_ASSERT(Batch);
+ m_DiskLayer.DeletePutBatch(Batch->DiskLayerHandle);
+ delete Batch;
}
struct ZenCacheNamespace::GetBatchHandle
@@ -210,16 +203,9 @@ ZenCacheNamespace::CommitGetBatch(GetBatchHandle* Batch)
void
ZenCacheNamespace::DeleteGetBatch(GetBatchHandle* Batch) noexcept
{
- try
- {
- ZEN_ASSERT(Batch);
- m_DiskLayer.DeleteGetBatch(Batch->DiskLayerHandle);
- delete Batch;
- }
- catch (const std::exception& Ex)
- {
- ZEN_ERROR("Exception in ZenCacheNamespace::DeleteGetBatch: '{}'", Ex.what());
- }
+ ZEN_ASSERT(Batch);
+ m_DiskLayer.DeleteGetBatch(Batch->DiskLayerHandle);
+ delete Batch;
}
bool
@@ -582,8 +568,11 @@ ZenCacheStore::PutBatch::~PutBatch()
{
try
{
- ZEN_ASSERT(m_NamespaceBatchHandle);
- m_Store->DeletePutBatch(m_NamespaceBatchHandle);
+ if (m_Store)
+ {
+ ZEN_ASSERT(m_NamespaceBatchHandle);
+ m_Store->DeletePutBatch(m_NamespaceBatchHandle);
+ }
}
catch (const std::exception& Ex)
{