[Bug] @extenddb/dev: start() leaves the server running when it misses the startup deadline

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

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

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

評価

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

調査の方向性

@extenddb/dev の start() と packaging/npm/test/launcher.test.js のシナリオ 11 から始めます。issue によると、シナリオでは現在、フェイクサーバーを手動で停止しています。起動タイムアウトによる reject と終了フックの登録を追い、その後 launcher のテストを実行します。start() が reject する前に起動したサーバーを停止し、シナリオ 11 で停止したことを確認できれば完了です。

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

説明

bug

Describe the bug

When start() in @extenddb/dev rejects because the server did not become healthy within startupTimeoutMs, the extenddb serve process that it spawned keeps running. start() registers its exit hook only after a successful start, so the server also outlives the process that called start(). packaging/README.md says that a launcher does not outlive the caller.

To Reproduce

  1. Call start({ memory: true, startupTimeoutMs: 2000 }) with a binary that answers /health later than 2 s after the start.
  2. start() rejects with "extenddb did not become healthy within the 2000ms startup timeout".
  3. The extenddb serve process is still running.

Scenario 11 of packaging/npm/test/launcher.test.js shows the same thing. It stops its fake server by hand: "start() does not stop a server that misses the deadline, so stop the fake here."

Expected behavior

start() stops the server before it rejects, as the detached mode of #1162 does.

Actual behavior

The server runs until something else stops it.

Environment

  • ExtendDB version: 1.0.0 (@extenddb/dev 1.0.0)
  • Operating system: any
  • Rust version (if building from source): n/a
  • Client SDK/driver and version: n/a
  • Deployment method (binary, container, source): npm

Logs / stack trace

n/a

Additional context

With the fix, scenario 11 can check that the fake server has stopped instead of stopping it.

Checklist

  • I have searched existing issues for duplicates
  • I have included the ExtendDB version and environment details
  • I can reproduce this with the latest release
主要言語
Rust
スター
517
フォーク
60
平均マージ
5日 1時間
マージ済み PR(30日)
132

環境構築

はじめの一歩

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

ExtendDB/extenddb のほかの issue

ExtendDB/extenddb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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