diff options
| author | EPICGAMES\thierry.begin <[email protected]> | 2024-04-08 10:43:16 -0400 |
|---|---|---|
| committer | EPICGAMES\thierry.begin <[email protected]> | 2024-04-08 10:43:16 -0400 |
| commit | b35e1258a043cab06950b2453f434861d99b918a (patch) | |
| tree | 695737774fa08ebaa0e32a9f95cb0247c34b3dc3 /src/zenstore/blockstore.cpp | |
| parent | Add docker support (diff) | |
| parent | Merge pull request #41 from ue-foundation/zs/import-oplog-clean (diff) | |
| download | zen-tb/docker.tar.xz zen-tb/docker.zip | |
Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen into tb/dockertb/docker
Diffstat (limited to 'src/zenstore/blockstore.cpp')
| -rw-r--r-- | src/zenstore/blockstore.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index 69487f9dc..a576ff022 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -482,7 +482,11 @@ BlockStore::TryGetChunk(const BlockStoreLocation& Location) const { if (const Ref<BlockStoreFile>& Block = BlockIt->second; Block) { - return Block->GetChunk(Location.Offset, Location.Size); + IoBuffer Chunk = Block->GetChunk(Location.Offset, Location.Size); + if (Chunk.GetSize() == Location.Size) + { + return Chunk; + } } } return IoBuffer(); @@ -911,7 +915,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, NewBlockFile = nullptr; } } - catch (std::system_error& SystemError) + catch (const std::system_error& SystemError) { if (IsOOM(SystemError.code())) { @@ -926,11 +930,11 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot, ZEN_ERROR("reclaiming space for '{}' failed with system error exception: '{}'", m_BlocksBasePath, SystemError.what()); } } - catch (std::bad_alloc& BadAlloc) + catch (const std::bad_alloc& BadAlloc) { ZEN_WARN("reclaiming space for '{}' ran out of memory: '{}'", m_BlocksBasePath, BadAlloc.what()); } - catch (std::exception& ex) + catch (const std::exception& ex) { ZEN_ERROR("reclaiming space for '{}' failed with: '{}'", m_BlocksBasePath, ex.what()); } |