Skip to content

Commit 228395c

Browse files
andrewjcgfacebook-github-bot
authored andcommitted
Fix hang-on-failure in sync_workspace (#880)
Summary: Pull Request resolved: #880 Previously, when doing an rsync-based code sync, we'd hang waiting for the rsync server proxy to finish after the rsync clients had already failed and reported back errors via the reply port. Fix to fail fast on any failure. Reviewed By: highker Differential Revision: D80267334 fbshipit-source-id: 5bcf02834799e80d0e2d6ae57046fdd1a7434af5
1 parent 364a22c commit 228395c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

monarch_hyperactor/src/code_sync/manager.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ pub async fn code_sync_mesh(
416416
}
417417
};
418418

419-
let (res1, res2) = futures::future::join(
419+
let ((), ()) = try_join!(
420420
method_fut,
421421
// This async task will cast the code sync message to workspace owners, and process any errors.
422422
async move {
@@ -450,15 +450,9 @@ pub async fn code_sync_mesh(
450450
.try_collect_or_stash::<()>(&mut errs);
451451
Ok(errs.into_result()?)
452452
},
453-
)
454-
.await;
455-
456-
// Combine code sync handler and cast errors into one.
457-
let mut errs = ErrorStash::<_, _, anyhow::Error>::new(|| "code sync failed");
458-
[res1, res2]
459-
.into_iter()
460-
.try_collect_or_stash::<()>(&mut errs);
461-
Ok(errs.into_result()?)
453+
)?;
454+
455+
Ok(())
462456
}
463457

464458
#[cfg(test)]

0 commit comments

Comments
 (0)