S3 connection hangs when S3 Put request times out server side.

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

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

評価

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

調査の方向性

s3_key_value_store.cc の764行目付近から始め、IssueRequestOptions を curl_transport.cc の198〜205行目付近まで追跡してください。request_timeout と connect_timeout が現在どのようにデフォルト設定されているか、また S3 ドライバーがそれらをどのように公開すべきかを確認してください。サーバー側のタイムアウトによってリクエストが中断されて再試行され、約30分間ハングし続けないことをもって完了とします。

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

説明

Hi google friends! Apologies for the trouble!! We found this interesting issue when using tensorstore!! Thanks for taking a look

Summary

When an S3 PUT request is timed out server-side, the TensorStore client can hang for ~30 minutes before retrying. During this window, S3 access logs show zero retries — the request appears to be "in flight" on the client but dead on the
server. The receive of the request is confirmed by s3 access logs.

The ~30-minute gap matches the default OS-level TCP keepalive + retransmission timeout, which is the only thing that eventually forces the stalled socket closed.

Root Cause

2 layers of missing timeout configuration compound each other:

1. S3 driver issues requests with no timeouts (s3_key_value_store.cc:764)

auto future = owner->transport_->IssueRequest(
    request, internal_http::IssueRequestOptions(value_));
// IssueRequestOptions only sets payload; request_timeout and connect_timeout
// remain at their defaults of absl::ZeroDuration().
  1. Zero duration → curl sets nothing (curl_transport.cc:198-205)

if (options.request_timeout > absl::ZeroDuration()) { // never true
handle_.SetOption(CURLOPT_TIMEOUT_MS, ...);
}

CURLOPT_TIMEOUT_MS is never set, so libcurl has no deadline on the transfer.

Workaround

Set environment variables before launching your process:

export TENSORSTORE_CURL_LOW_SPEED_TIME_SECONDS=30
export TENSORSTORE_CURL_LOW_SPEED_LIMIT_BYTES=1

This enables the low-speed watchdog: if fewer than 1 byte/sec is transferred for 30 seconds, libcurl aborts the request and the retry logic takes over.

Suggested fix

  • Expose request timeout and connect timeout to s3 query driver
主要言語
C++
スター
1.6k
フォーク
151
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

google/tensorstore のほかの issue

google/tensorstore の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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