From 512102ef3d2fff054691a1a23350a36f8fe6807c Mon Sep 17 00:00:00 2001 From: Peng Zhang Date: Mon, 10 Nov 2025 14:43:15 -0800 Subject: [PATCH] Make Instance:;start infallible Differential Revision: D86693429 --- hyperactor/src/proc.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hyperactor/src/proc.rs b/hyperactor/src/proc.rs index 48dac18db..d94c42d77 100644 --- a/hyperactor/src/proc.rs +++ b/hyperactor/src/proc.rs @@ -514,10 +514,10 @@ impl Proc { .ledger .insert(actor_id.clone(), instance.cell.downgrade())?; - instance + Ok(instance .start(actor, actor_loop_receivers.take().unwrap(), work_rx) .instrument(span) - .await + .await) } /// Create and return an actor instance and its corresponding handle. This allows actors to be @@ -575,9 +575,9 @@ impl Proc { let (instance, mut actor_loop_receivers, work_rx) = Instance::new(self.clone(), actor_id, false, Some(parent.clone())); let actor = A::new(params).await?; - instance + Ok(instance .start(actor, actor_loop_receivers.take().unwrap(), work_rx) - .await + .await) } /// Call `abort` on the `JoinHandle` associated with the given @@ -1061,13 +1061,13 @@ impl Instance { /// Start an A-typed actor onto this instance with the provided params. When spawn returns, /// the actor has been linked with its parent, if it has one. - #[hyperactor::instrument(fields(actor_id=self.cell.actor_id().clone().to_string(), actor_name=self.cell.actor_id().name()))] + #[hyperactor::instrument_infallible(fields(actor_id=self.cell.actor_id().clone().to_string(), actor_name=self.cell.actor_id().name()))] async fn start( self, actor: A, actor_loop_receivers: (PortReceiver, PortReceiver), work_rx: mpsc::UnboundedReceiver>, - ) -> Result, anyhow::Error> { + ) -> ActorHandle { let instance_cell = self.cell.clone(); let actor_id = self.cell.actor_id().clone(); let actor_handle = ActorHandle::new(self.cell.clone(), self.ports.clone()); @@ -1081,7 +1081,7 @@ impl Instance { .set(actor_task_handle) .unwrap_or_else(|_| panic!("{}: task handle store failed", actor_id)); - Ok(actor_handle) + actor_handle } async fn serve(