[Rust Frontend] Improve startup failure and readiness logs (#50406)
Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
45b60e3914
commit
e9096fcb12
@@ -5,11 +5,12 @@ mod cli;
|
||||
|
||||
use std::env;
|
||||
use std::ffi::OsStr;
|
||||
use std::process::ExitStatus;
|
||||
use std::process::{ExitCode, ExitStatus};
|
||||
|
||||
use anyhow::{Context, Result, anyhow, bail};
|
||||
use thiserror_ext::AsReport as _;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{info, warn};
|
||||
use tracing::{error, info, warn};
|
||||
use vllm_managed_engine::ManagedEngineHandle;
|
||||
|
||||
use crate::cli::{BenchCommand, Cli, Command};
|
||||
@@ -81,7 +82,7 @@ fn shutdown_signal() -> CancellationToken {
|
||||
token
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
fn main() -> ExitCode {
|
||||
let process_label =
|
||||
match env::args_os().nth(1).as_deref().and_then(OsStr::to_str).unwrap_or_default() {
|
||||
"bench" => "Bench",
|
||||
@@ -98,10 +99,18 @@ fn main() -> Result<()> {
|
||||
runtime.worker_threads(worker_threads);
|
||||
}
|
||||
|
||||
runtime
|
||||
let result = runtime
|
||||
.build()
|
||||
.context("failed to build Tokio runtime")?
|
||||
.block_on(async_main(cli))
|
||||
.context("failed to build Tokio runtime")
|
||||
.and_then(|runtime| runtime.block_on(async_main(cli)));
|
||||
|
||||
match result {
|
||||
Ok(()) => ExitCode::SUCCESS,
|
||||
Err(error) => {
|
||||
error!("process failed with error: {:#?}", error.as_report());
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn async_main(cli: Cli) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user