Blocking Docker stdout reads bypass the live result polling timeout

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

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

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

評価

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

調査の方向性

lean/components/docker/docker_manager.py の read_from_file メソッドから始めて、周囲の timeout/interval ループを読んでください。無制限の呼び出しは Popen ハンドル上の stdout.read() です。既存の docker manager テストを探してメソッドがどのように実行されるかを確認し、issue に書かれているとおりに FIFO writer で再現してください。完了とは、stdout を開いたままにする Docker exec がタイムアウト付近で診断情報とともに戻り、起動されたサブプロセスがすべてクリーンアップされ、即座に成功する読み取りは引き続き成功することです。

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

説明

priority:P2

Problem

DockerManager.read_from_file checks its timeout only between attempts. Popen(...).stdout.read() has no deadline, so a Docker exec that never closes stdout can block the method indefinitely despite its timeout argument.

Reproduction and evidence

A minimal real-Docker reproduction uses a running Bash container:

  1. Create /tmp/delayed-fifo with mkfifo.
  2. Start another exec that waits 0.6 seconds, then writes {"Success":true} into the FIFO.
  3. Call read_from_file(container_name, Path('/tmp/delayed-fifo'), interval=0.01, timeout=0.05).

On current master, the call returned success after 0.698 seconds, well beyond its 0.05-second timeout. If the writer never writes or closes the FIFO, the read has no bound. The FIFO demonstrates the blocking stream; a stalled Docker exec can leave stdout open in the same way.

Relevant code: lean/components/docker/docker_manager.py, the stdout.read() in read_from_file.

Required result

Waiting for a Docker exec must not bypass the result wait's deadline. On expiry, clean up any subprocess the method started and return a useful timeout diagnostic. Preserve immediate successful reads. Suggestion: use a subprocess communication API with the remaining timeout rather than an unbounded stream read.

主要言語
Python
スター
335
フォーク
172
平均マージ
6時間 54分
マージ済み PR(30日)
37

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

QuantConnect/lean-cli のほかの issue

QuantConnect/lean-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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