aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-04-08 13:52:23 +0200
committerGitHub Enterprise <[email protected]>2026-04-08 13:52:23 +0200
commit8318ec626584a6b39a73d7275b0015fadd983ba6 (patch)
tree5d20e90419a838069fbe356aba3c8eb3c0255524
parentfix missing chunk in oplog export (#925) (diff)
downloadzen-8318ec626584a6b39a73d7275b0015fadd983ba6.tar.xz
zen-8318ec626584a6b39a73d7275b0015fadd983ba6.zip
don't hard fail if .pending folder is not empty on oplog export (#926)
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zencore/iobuffer.cpp7
-rw-r--r--src/zenremotestore/projectstore/remoteprojectstore.cpp5
3 files changed, 11 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 252eaee24..5a8d270b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@
- Improvement: Cache and Projects pages now paginate and sort lists consistently with the front page
- Improvement: Hub dashboard adds obliterate button for individual, bulk, and by-name module deletion
- Bugfix: Fixed hub Consul health check registering with `/hub/health` endpoint which does not exist; now uses `/health`
+- Bugfix: Fixed oplog export crash when a temp attachment file already exists in the pending directory
- Bugfix: Hub dashboard Resources tile was missing total disk space
- Bugfix: Fixed oplog export losing small attachments when block reuse is active; reused blocks were omitted from the container
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp
index c47c54981..117011a32 100644
--- a/src/zencore/iobuffer.cpp
+++ b/src/zencore/iobuffer.cpp
@@ -210,7 +210,12 @@ IoBufferExtendedCore::~IoBufferExtendedCore()
// Mark file for deletion when final handle is closed
FILE_DISPOSITION_INFO Fdi{.DeleteFile = TRUE};
- SetFileInformationByHandle(m_FileHandle, FileDispositionInfo, &Fdi, sizeof Fdi);
+ if (!SetFileInformationByHandle(m_FileHandle, FileDispositionInfo, &Fdi, sizeof Fdi))
+ {
+ ZEN_WARN("SetFileInformationByHandle(DeleteOnClose) failed for file handle {}, reason '{}'",
+ m_FileHandle,
+ GetLastErrorAsString());
+ }
#else
std::error_code Ec;
std::filesystem::path FilePath = zen::PathFromHandle(m_FileHandle, Ec);
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp
index 07588e58e..e4d0d7cd2 100644
--- a/src/zenremotestore/projectstore/remoteprojectstore.cpp
+++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp
@@ -392,7 +392,10 @@ namespace remotestore_impl {
OodleCompressor Compressor,
OodleCompressionLevel CompressionLevel)
{
- ZEN_ASSERT(!IsFile(AttachmentPath));
+ if (IsFile(AttachmentPath))
+ {
+ ZEN_WARN("Temp attachment file already exists at '{}', truncating", AttachmentPath);
+ }
BasicFile CompressedFile;
std::error_code Ec;
CompressedFile.Open(AttachmentPath, BasicFile::Mode::kTruncateDelete, Ec);