diff options
| author | Dan Engelbrecht <[email protected]> | 2023-10-02 12:00:00 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-02 12:00:00 +0200 |
| commit | 0abf7994e8913c19360a0f0b8527495c0f99de87 (patch) | |
| tree | a9a0338d69a95a6f20d9634a2a0e9f5b1595b639 /src/zencore/iobuffer.cpp | |
| parent | Limit size of memory cache layer (#423) (diff) | |
| download | zen-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.cpp | 26 |
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, |