Repository navigation
B #8187: Clean up temporary staging files on failure in Ceph cp driver - #8188
Draft
trukhinyuri wants to merge 1 commit into
Draft
trukhinyuri wants to merge 1 commit into
trukhinyuri wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The signal traps perform cleanup but suppress termination, allowing execution to continue after interruption.
1 open finding
What changed in this PR
Adds cleanup for temporary Ceph staging files during failed or interrupted image imports.
Changes:
- Adds local and remote cleanup traps.
- Clears the local trap after successful registration.
| File | Description |
|---|---|
src/datastore_mad/remotes/ceph/cp |
Cleans temporary staging artifacts during transfer and registration. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
trukhinyuri
force-pushed
the
fix/ceph-cp-cleanup-tmp
branch
from
October 14, 2026 16:43
f58c758 to
53e2936
Compare
…h cp driver In src/datastore_mad/remotes/ceph/cp, temporary staging files ($TMP_DST, $TMP_DST.raw, $TMP_DST.d) on the bridge host were only removed at the end of REGISTER_CMD after all commands succeeded. If the initial transfer failed or if qemu-img convert / rbd import failed under set -e, the temporary files remained in $STAGING_DIR. Add EXIT cleanup traps and INT/TERM exit handlers inside REGISTER_CMD on $DST_HOST and around the transfer phase in ceph/cp (cleared before normal completion) so staging artifacts are cleaned up once on failure or signal interruption. Signed-off-by: Iurii Trukhin <yuri@trukhin.com>
trukhinyuri
force-pushed
the
fix/ceph-cp-cleanup-tmp
branch
from
October 15, 2026 00:21
53e2936 to
da596f8
Compare
paczerny
approved these changes
Oct 31, 2026
rsmontero
marked this pull request as draft
November 2, 2026 11:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #8187.
In
src/datastore_mad/remotes/ceph/cp, temporary files in$STAGING_DIRon$DST_HOST($TMP_DST,$TMP_DST.raw,$TMP_DST.d) are only removed at the end ofREGISTER_CMDif all commands succeed. Whenqemu-img convert -O raworrbd importfails underset -e, or when the initial stream to$DST_HOST:$TMP_DSTfails, the staging files are left behind in/var/tmpon the bridge host.Add an
EXIT INT TERMtrap insideREGISTER_CMDon$DST_HOSTand a trap inceph/cparound the transfer/registration phase (cleared before normal exit) so$TMP_DST*is cleaned up on error or interruption.Branches to which this PR applies