diff --git a/rivetkit-rust/packages/rivetkit-core/src/actor/task.rs b/rivetkit-rust/packages/rivetkit-core/src/actor/task.rs index d71894936c..6ecd94c187 100644 --- a/rivetkit-rust/packages/rivetkit-core/src/actor/task.rs +++ b/rivetkit-rust/packages/rivetkit-core/src/actor/task.rs @@ -1160,6 +1160,7 @@ impl ActorTask { } fn dispatch_lifecycle_error(&self) -> Option { + // TODO: Share admission policy with RegistryDispatcher::active_actor. if self.ctx.destroy_requested() { self.ctx.warn_work_sent_to_stopping_instance("dispatch"); return Some(ActorLifecycleError::Destroying.build()); diff --git a/rivetkit-rust/packages/rivetkit-core/src/registry/http.rs b/rivetkit-rust/packages/rivetkit-core/src/registry/http.rs index 503bd3b00f..0333c4095b 100644 --- a/rivetkit-rust/packages/rivetkit-core/src/registry/http.rs +++ b/rivetkit-rust/packages/rivetkit-core/src/registry/http.rs @@ -625,6 +625,19 @@ pub(super) fn normalize_actor_request_path(path: &str) -> String { } } +#[cfg(test)] +pub(super) fn is_actor_request_path(path: &str) -> bool { + let Some(stripped) = path.strip_prefix("/request") else { + return false; + }; + + stripped.is_empty() + || stripped + .as_bytes() + .first() + .is_some_and(|byte| matches!(byte, b'/' | b'?')) +} + pub(super) fn build_envoy_response(response: Response) -> Result { let (status, headers, body) = response.to_parts(); diff --git a/rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs b/rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs index f74387f4e0..1f23e56408 100644 --- a/rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs +++ b/rivetkit-rust/packages/rivetkit-core/src/registry/mod.rs @@ -808,6 +808,7 @@ impl RegistryDispatcher { match instance.get() { ActorInstanceState::Active(instance) => { let instance = instance.clone(); + // TODO: Share admission policy with ActorTask::dispatch_lifecycle_error. if instance.ctx.started() { if instance.ctx.destroy_requested() { instance