fix(resources): clean up temp dir after incremental sync#1759
Open
arminzou wants to merge 1 commit intovolcengine:mainfrom
Open
fix(resources): clean up temp dir after incremental sync#1759arminzou wants to merge 1 commit intovolcengine:mainfrom
arminzou wants to merge 1 commit intovolcengine:mainfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
After a successful sync_diff, the temp parent directory was left as an empty shell on disk because delete_temp was never called for the incremental path. Call delete_temp on the temp parent URI after sync_diff succeeds.
50b0931 to
635a0f5
Compare
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.
Summary
When
sync_diff_callbacksuccessfully completes an incremental update (watch-triggered or explicit re-add), the temp directory tree used as the diff source was never removed fromviking://temp/. Over time this left behind one empty temp directory shell per watch tick, accumulating indefinitely.This PR adds a cleanup step inside
sync_diff_callback(inSemanticDagExecutor) that removes the temp parent directory immediately after a successful sync, mirroring the cleanup that already happens on the new-resource path inResourceProcessor.Root cause:
delete_tempwas only called on error paths or inResourceProcessorfor the first-add case. The incremental-update success path inSemanticDagExecutorhad no corresponding cleanup.Fix: After the
logger.info(f"[SyncDiff] Diff computed: ...")line insync_diff_callback, compute the parent URI fromself._root_uriand calldelete_tempif it lives underviking://temp/. Failures are caught and logged as warnings (non-fatal).Type of Change
Testing
data/viking/<account>/temp/after the sync completes.test_resource_processor_first_add_persist_does_not_await_agfs_mv— fails onorigin/mainas well due to an uninitializedLockManagerin the test fixture; unrelated to this change).Related Issues
N/A
Checklist
/cc @chuanbao666 @baojun-zhang @myysy