aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/iobuffer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-02 12:00:00 +0200
committerGitHub <[email protected]>2023-10-02 12:00:00 +0200
commit0abf7994e8913c19360a0f0b8527495c0f99de87 (patch)
treea9a0338d69a95a6f20d9634a2a0e9f5b1595b639 /src/zencore/iobuffer.cpp
parentLimit size of memory cache layer (#423) (diff)
downloadzen-0abf7994e8913c19360a0f0b8527495c0f99de87.tar.xz
zen-0abf7994e8913c19360a0f0b8527495c0f99de87.zip
Handle OOM and OOD more gracefully to not spam Sentry with error reports (#434)
- Improvement: Catch Out Of Memory and Out Of Disk exceptions and report back to reqeuster without reporting an error to Sentry - Improvement: If creating bucket fails when storing and item in the structured cache, log a warning and propagate error to requester without reporting an error to Sentry - Improvement: Make an explicit flush of the active block written to in blockstore flush - Improvement: Make sure cache and cas MakeIndexSnapshot does not throw exception on failure which would cause and abnormal termniation at exit
Diffstat (limited to 'src/zencore/iobuffer.cpp')
-rw-r--r--src/zencore/iobuffer.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp
index 09cd0a000..74fec4c51 100644
--- a/src/zencore/iobuffer.cpp
+++ b/src/zencore/iobuffer.cpp
@@ -339,12 +339,12 @@ IoBufferExtendedCore::Materialize() const
if (Error || (BytesRead != m_DataBytes))
{
std::error_code DummyEc;
- ZEN_ERROR("ReadFile/pread failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x}), {}",
- m_FileOffset,
- m_DataBytes,
- zen::PathFromHandle(m_FileHandle, DummyEc),
- zen::FileSizeFromHandle(m_FileHandle),
- GetSystemErrorAsString(Error));
+ ZEN_WARN("ReadFile/pread failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x}), {}",
+ m_FileOffset,
+ m_DataBytes,
+ zen::PathFromHandle(m_FileHandle, DummyEc),
+ zen::FileSizeFromHandle(m_FileHandle),
+ GetSystemErrorAsString(Error));
throw std::system_error(std::error_code(Error, std::system_category()),
fmt::format("ReadFile/pread failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x})",
m_FileOffset,
@@ -379,7 +379,7 @@ IoBufferExtendedCore::Materialize() const
{
int32_t Error = zen::GetLastError();
std::error_code DummyEc;
- ZEN_ERROR("CreateFileMapping failed on file '{}', {}", zen::PathFromHandle(m_FileHandle, DummyEc), GetSystemErrorAsString(Error));
+ ZEN_WARN("CreateFileMapping failed on file '{}', {}", zen::PathFromHandle(m_FileHandle, DummyEc), GetSystemErrorAsString(Error));
throw std::system_error(std::error_code(Error, std::system_category()),
fmt::format("CreateFileMapping failed on file '{}'", zen::PathFromHandle(m_FileHandle, DummyEc)));
}
@@ -412,12 +412,12 @@ IoBufferExtendedCore::Materialize() const
#endif // ZEN_PLATFORM_WINDOWS
std::error_code DummyEc;
- ZEN_ERROR("MapViewOfFile/mmap failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x}), {}",
- MapOffset,
- MapSize,
- zen::PathFromHandle(m_FileHandle, DummyEc),
- zen::FileSizeFromHandle(m_FileHandle),
- GetSystemErrorAsString(Error));
+ ZEN_WARN("MapViewOfFile/mmap failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x}), {}",
+ MapOffset,
+ MapSize,
+ zen::PathFromHandle(m_FileHandle, DummyEc),
+ zen::FileSizeFromHandle(m_FileHandle),
+ GetSystemErrorAsString(Error));
throw std::system_error(std::error_code(Error, std::system_category()),
fmt::format("MapViewOfFile failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x})",
MapOffset,