Docker: five images ignore docker stop and are killed at the timeout

オープン
#5,611 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, typescript

調査の方向性

Read the five affected image definitions under src/filesystem, src/sequentialthinking, src/fetch, src/git, and src/time, then compare their stop behavior with everything and memory. Run the provided Docker reproduction and inspect scripts/image-smoke.mjs for the cleanStop checks. Done means all five containers stop promptly with their server's exit and the smoke entries assert clean stops; the signal handling approach still needs a decision.

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

説明

enhancement v2

Problem

Five of the seven Docker images do not exit on docker stop: filesystem, sequentialthinking, fetch, git and time. Docker sends the stop signal, the server ignores it, and Docker kills the container when its timeout runs out (exit 137). everything and memory exit on their own (exit 0 and 130), because their images declare STOPSIGNAL SIGINT and their servers handle it (#5485 for memory).

The cause is the same in each: the server runs as PID 1, which gets no default signal disposition, so a SIGTERM it installed no handler for is dropped.

Found while building the image smoke for #5598, which asserts a clean stop only for the two images that have one today.

Reproduce

Built from v2/main at 7f383a8e, Docker 29.8.1:

docker build -f src/filesystem/Dockerfile -t mcp/filesystem .
id=$(docker run -d -i mcp/filesystem /tmp)
docker stop "$id"                                   # waits out the timeout
docker inspect -f '{{.State.ExitCode}}' "$id"       # 137

The same for sequentialthinking, and for fetch, git and time built from their own directories. All five exit 137; everything exits 0 and memory 130.

Expected

docker stop ends each container promptly and with the server's own exit, as it does for everything and memory. None of the five keeps state that a kill corrupts today, so what a user sees is the stop taking the full timeout (10 seconds by default), per container, on every docker stop, docker compose down or orchestrator restart, most visibly when the server runs over Streamable HTTP.

To decide

  • Per image: a STOPSIGNAL the server already handles, a signal handler in the server, or an init process (docker run --init, tini) in the image.
  • When an image gains a clean stop, set cleanStop: true on its entry in scripts/image-smoke.mjs, so the image smoke asserts it (a script test already requires it of any image that declares a STOPSIGNAL).
主要言語
TypeScript
スター
92k
フォーク
12k
平均マージ
3時間 46分
マージ済み PR(30日)
206

環境構築

はじめの一歩

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

modelcontextprotocol/servers のほかの issue

modelcontextprotocol/servers の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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