fix: improve logging around failed chunked object store uploads

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-02-27 14:50:49 +01:00
parent fea2f67f38
commit ccb1d9afa7

View file

@ -818,7 +818,6 @@ class ObjectStoreStorage extends Common implements IChunkedFileWrite {
$this->getCache()->update($stat['fileid'], $stat);
}
} catch (S3MultipartUploadException|S3Exception $e) {
$this->objectStore->abortMultipartUpload($urn, $writeToken);
$this->logger->error(
'Could not complete multipart upload ' . $urn . ' with uploadId ' . $writeToken,
[
@ -826,6 +825,17 @@ class ObjectStoreStorage extends Common implements IChunkedFileWrite {
'exception' => $e,
]
);
try {
$this->objectStore->abortMultipartUpload($urn, $writeToken);
} catch (S3Exception $e) {
$this->logger->error(
'Failed to abort multi-part upload for ' . $urn . ' with uploadId ' . $writeToken,
[
'app' => 'objectstore',
'exception' => $e,
]
);
}
throw new GenericFileException('Could not write chunked file');
}
return $size;