This repository was archived by the owner on Oct 19, 2026. It is now read-only.
Repository navigation
temp: skip antares fs unmount after build for post-build inspection #1983
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -583,18 +583,21 @@ impl Drop for MountGuard { | |
| if self.unmounted.load(Ordering::Acquire) { | ||
| return; | ||
| } | ||
| let mount_id = self.mount_id.clone(); | ||
| let task_id: String = self.task_id.clone(); | ||
| // Spawn a task to handle the unmounting asynchronously | ||
| // Since the unmount operation is idempotent, it's safe to perform asynchronously | ||
| // even if the spawned task doesn't complete before program exit. | ||
| // Multiple calls to unmount the same mount_id should be safe and have no side effects. | ||
| tokio::spawn(async move { | ||
| match unmount_antares_fs(&mount_id).await { | ||
| Ok(_) => tracing::info!("[Task {}] Filesystem unmounted successfully.", task_id), | ||
| Err(e) => tracing::error!("[Task {}] Failed to unmount filesystem: {}", task_id, e), | ||
| } | ||
| }); | ||
| // TODO: Temporarily keep mounts alive — skip auto-unmount on drop. | ||
| // Re-enable the spawn block below once post-build inspection is no longer needed. | ||
| tracing::info!( | ||
| "[Task {}] MountGuard dropped but unmount is temporarily disabled (mount_id={}).", | ||
| self.task_id, | ||
| self.mount_id, | ||
| ); | ||
| // let mount_id = self.mount_id.clone(); | ||
| // let task_id: String = self.task_id.clone(); | ||
| // tokio::spawn(async move { | ||
| // match unmount_antares_fs(&mount_id).await { | ||
| // Ok(_) => tracing::info!("[Task {}] Filesystem unmounted successfully.", task_id), | ||
| // Err(e) => tracing::error!("[Task {}] Failed to unmount filesystem: {}", task_id, e), | ||
| // } | ||
| // }); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -640,6 +643,7 @@ pub async fn build( | |
|
|
||
| const MAX_TARGETS_ATTEMPTS: usize = 2; | ||
| let mut mount_point = None; | ||
| let mut old_repo_mount_point_saved = None; | ||
| let mut mount_guard = None; | ||
| let mut mount_guard_old_repo = None; | ||
| let mut targets: Vec<TargetLabel> = Vec::new(); | ||
|
|
@@ -686,6 +690,7 @@ pub async fn build( | |
| { | ||
| Ok(found_targets) => { | ||
| mount_point = Some(repo_mount_point); | ||
| old_repo_mount_point_saved = Some(old_repo_mount_point.clone()); | ||
| mount_guard = Some(guard); | ||
| mount_guard_old_repo = Some(guard_old_repo); | ||
| targets = found_targets; | ||
|
|
@@ -834,8 +839,25 @@ pub async fn build( | |
| } | ||
| .await; | ||
|
|
||
| mount_guard.unmount().await; | ||
| mount_guard_old_repo.unmount().await; | ||
| // TODO: Temporarily keep mounts alive for debugging / post-build inspection. | ||
| // Unmount is intentionally skipped here. Remember to re-enable once no longer needed. | ||
| // mount_guard.unmount().await; | ||
| // mount_guard_old_repo.unmount().await; | ||
| tracing::info!( | ||
| "[Task {}] Skipping unmount — mount directories are retained for inspection: \ | ||
| new_repo mountpoint={}, mount_id={}; \ | ||
| old_repo mountpoint={}, mount_id={}", | ||
| id, | ||
| mount_point, | ||
| mount_guard.mount_id, | ||
| old_repo_mount_point_saved.as_deref().unwrap_or("<unknown>"), | ||
| mount_guard_old_repo.mount_id, | ||
| ); | ||
| // Prevent the Drop impl from unmounting. | ||
| mount_guard.unmounted.store(true, Ordering::Release); | ||
| mount_guard_old_repo | ||
| .unmounted | ||
| .store(true, Ordering::Release); | ||
|
Comment on lines
+857
to
+860
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Setting both guards to Useful? React with 👍 / 👎. |
||
|
|
||
| build_result | ||
| } | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling cleanup in
MountGuard::dropleaks mounts on error paths that still depend on RAII cleanup: inbuild(), the old-repo mount is created beforemount_antares_fs(&id_for_repo, cl_arg).await?, so if the second mount fails the function returns early andguard_old_repois dropped without any explicitunmount()call. With drop-time unmount now disabled, those failed attempts leave stale Antares mounts behind and can accumulate until mount capacity or disk is exhausted.Useful? React with 👍 / 👎.