lemonade: a failed backend install during serve leaves the spawned lemond running

オープン 初心者向け
#729 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
backend, devtools

調査の方向性

engines/lemonade/src/lib.rs の spawn_lemond の後にあるルーター分岐を読み、そのエラー処理を backend_alignment.rs の install_best_llamacpp_backend と比較してください。issue で言及されている既存の serve 準備リカバリーパスを確認し、バックエンドのインストール失敗を発生させる方法を探してください。準備状況の確認またはバックエンドの選択に失敗したとき、起動した子プロセスを停止して終了を待ち、lemond プロセスが残らないことをテストで確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

What happens

In the Lemonade engine's serve path (engines/lemonade/src/lib.rs, the router branch after spawn_lemond), two early returns leave the spawned lemond running:

let mut child = crate::process::spawn_lemond(...)?;
...
crate::process::wait_for_lemonade_cli_status(...)
    .context("Lemonade server did not become ready")?;          // returns, child left running
let backend = crate::backend_alignment::ensure_best_llamacpp_backend(...)
    .context("failed to select a supported Lemonade llama.cpp backend")?; // same

The later failure paths in the same function (load_result failing, or the router not reporting the model) do call terminate_pid(child.id(), true) and child.wait() before returning. Its sibling install_best_llamacpp_backend in backend_alignment.rs does the same unconditionally around the same two calls.

Why it matters

When the llama.cpp backend install fails, which is exactly the case rocm serve already retries once and then tells the user to rocm engines install lemonade --reinstall, the engine exits with an error but its lemond keeps running. It still holds the port and its state.

Not verified

Whether anything on the rocm serve side later reaps that lemond, for example a stop through the service record that recorded its pid via write_running_state(..., Some(child.id()), "running"). This was found by reading the code. In the e2e suite the harness's teardown kills it, so no test shows the leak.

Suggested fix

Run both calls inside a closure and terminate the child on its Err, as install_best_llamacpp_backend does. Add a unit or e2e assertion that no lemond survives a failed backend install; @id:serve-lemonade-preparation-recovery already drives that failure with a planted runtime once #351 lands.

Raised in review on #351.

主要言語
Rust
スター
49
フォーク
14
平均マージ
3日 6時間
マージ済み PR(30日)
183

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ROCm/rocm-cli のほかの issue

ROCm/rocm-cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。