diff --git a/src/runtime2/scheduler.rs b/src/runtime2/scheduler.rs index e7b6bc05c059714590c04c83b649bd68f9845c18..4f7c83bbe328312359205cdaa20633ea9b30cca9 100644 --- a/src/runtime2/scheduler.rs +++ b/src/runtime2/scheduler.rs @@ -148,7 +148,17 @@ impl Scheduler { if let Some(target_port) = message.target_port() { if let Some(other_component_id) = scheduled.router.should_reroute(target_port) { self.debug_conn(connector_id, " ... Rerouting the message"); - self.runtime.send_message(other_component_id, message); + + // We insert directly into the private inbox. Since we have + // a reroute entry the component can not yet be running. + if let Message::Control(_) = &message { + self.runtime.send_message(other_component_id, message); + } else { + let key = unsafe { ConnectorKey::from_id(other_component_id) }; + let component = self.runtime.get_component_private(&key); + component.ctx.inbox.insert_new(message); + } + continue; }