From 87b98d6d6cd91768b81e614e0d34d3e7e487dc50 Mon Sep 17 00:00:00 2001 From: Will Eaton Date: Fri, 12 Jun 2026 03:39:27 -0400 Subject: [PATCH] [Rust Frontend][Bugfix] Forward --shutdown-timeout and --disable-log-stats to the managed Python engine (#45300) Signed-off-by: Will Eaton --- rust/src/cmd/src/cli.rs | 2 ++ rust/src/cmd/src/cli/tests.rs | 34 ++++++++++++++++++++++++++++++ rust/src/managed-engine/src/cli.rs | 11 ++++++++++ 3 files changed, 47 insertions(+) diff --git a/rust/src/cmd/src/cli.rs b/rust/src/cmd/src/cli.rs index 12a85421bd..b49d100da6 100644 --- a/rust/src/cmd/src/cli.rs +++ b/rust/src/cmd/src/cli.rs @@ -468,6 +468,8 @@ impl ServeArgs { self.runtime.model.clone(), self.runtime.max_model_len, self.runtime.language_model_only, + self.runtime.disable_log_stats, + self.runtime.shutdown_timeout, handshake_port, ) } diff --git a/rust/src/cmd/src/cli/tests.rs b/rust/src/cmd/src/cli/tests.rs index e351e7e1c8..c6bd7c2b12 100644 --- a/rust/src/cmd/src/cli/tests.rs +++ b/rust/src/cmd/src/cli/tests.rs @@ -100,6 +100,40 @@ fn serve_args_auto_forward_enable_lora_to_python() { assert_eq!(args.managed_engine.python_args, vec!["--enable-lora"]); } +#[test] +fn serve_args_forward_shutdown_timeout_to_managed_engine() { + let cli = Cli::try_parse_from([ + "vllm-rs", + "serve", + "Qwen/Qwen3-0.6B", + "--shutdown-timeout", + "60", + ]) + .unwrap(); + + let Command::Serve(args) = cli.command else { + panic!("expected serve args"); + }; + assert_eq!(args.runtime.shutdown_timeout, 60); + + let config = args.to_managed_engine_config(5555); + assert_eq!(config.python_args, vec!["--shutdown-timeout", "60"]); +} + +#[test] +fn serve_args_forward_disable_log_stats_to_managed_engine() { + let cli = Cli::try_parse_from(["vllm-rs", "serve", "Qwen/Qwen3-0.6B", "--disable-log-stats"]) + .unwrap(); + + let Command::Serve(args) = cli.command else { + panic!("expected serve args"); + }; + assert!(args.runtime.disable_log_stats); + + let config = args.to_managed_engine_config(5555); + assert_eq!(config.python_args, vec!["--disable-log-stats"]); +} + #[test] fn serve_args_auto_forward_python_multi_char_alias_without_separator() { let cli = Cli::try_parse_from(["vllm-rs", "serve", "Qwen/Qwen3-0.6B", "-tp", "2"]).unwrap(); diff --git a/rust/src/managed-engine/src/cli.rs b/rust/src/managed-engine/src/cli.rs index d70870dc32..b6619b7a49 100644 --- a/rust/src/managed-engine/src/cli.rs +++ b/rust/src/managed-engine/src/cli.rs @@ -72,6 +72,8 @@ impl ManagedEngineArgs { model: String, max_model_len: Option, language_model_only: bool, + disable_log_stats: bool, + shutdown_timeout: u64, handshake_port: u16, ) -> ManagedEngineConfig { let mut python_args = self.python_args; @@ -83,6 +85,15 @@ impl ManagedEngineArgs { if language_model_only { python_args.push("--language-model-only".to_string()); } + if disable_log_stats { + python_args.push("--disable-log-stats".to_string()); + } + // we must pass through shutdown_timeout to the engine, + // otherwise inflight requests get aborted on shutdown + if shutdown_timeout > 0 { + python_args.push("--shutdown-timeout".to_string()); + python_args.push(shutdown_timeout.to_string()); + } if let Some(data_parallel_size_local) = self.data_parallel_size_local { python_args.push("--data-parallel-size-local".to_string()); python_args.push(data_parallel_size_local.to_string());