One failed session lock renewal loses the session: no retry, no log, no signal to running activities
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start at the renewal loop in src/runtime/dispatchers/worker.rs around lines 899-926, where the error branch only warns and waits for the next tick, and read the defaults in src/runtime/mod.rs lines 365-366 that set the 25 s interval against a 30 s lock timeout. Then follow the renewal call into the provider (duroxide-pg renews only rows with locked_until > now and returns Ok(0) on a mismatch) to see why a late retry silently matches nothing. Done means a failed renewal is retried before expiry, a row-count shortfall against in-flight sessions is logged, and lost sessions reach their activities' cancellation token.
索引モデルが issue の本文から書いたものです。
説明
Summary
The session manager renews all session locks of a runtime with one renew_session_lock call per interval. If that call fails once, it is not tried again before the locks expire. The sessions are then lost without a log line, and the activities that run on those sessions are not told.
Where
run_session_manager. The error branch only logs a warning and waits for the next tick: https://github.com/microsoft/duroxide/blob/6a458861763a7aa5b78a7c1c97691a6f00489a8b/src/runtime/dispatchers/worker.rs#L899-L926- Defaults:
session_lock_timeoutis 30 s andsession_lock_renewal_bufferis 5 s, so the renewal runs every 25 s: https://github.com/microsoft/duroxide/blob/6a458861763a7aa5b78a7c1c97691a6f00489a8b/src/runtime/mod.rs#L365-L366
How it fails
- The renewal at T+25 s fails once, for example on a dropped connection or a pool timeout.
- The next attempt is the next tick, at T+50 s. The locks expired at T+30 s.
- A provider renews only a lock that is still valid (
duroxide-pgrequireslocked_until > now). So the renewal at T+50 s matches 0 rows. It returnsOk(0), and a count of 0 is not logged. - From T+30 s another worker can claim the session. The activities of the first worker for that session still run. Two workers now work on the same session.
How this was checked
Read in the code. Not reproduced.
Suggested fix
- Retry a failed renewal soon, for example every second, until it works or the lock timeout has passed.
- Compare the number of renewed rows with the number of sessions that this runtime has in flight. Log a warning when a session was lost.
- Signal the activities of a lost session through their cancellation token, or report the loss to the host. #38 (item 6) asks for session lease events. This failure is the case that needs them most.
Tracked in #55.
- 主要言語
- Rust
- スター
- 221
- フォーク
- 61
- 平均マージ
- 3日 5時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/duroxide のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
prune_kv_values_updated_before emits actions in HashMap order; replay fails with `kv clear mismatch`対応中かも @akhil9tiet が 5 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/duroxide の issue をすべて見る
似ている issue
-
enhancement user-priority/P3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
element-hq/lk-jwt-service#248 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged bug bughunt pm:pipenv priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SocketDev/socket-patch#1219 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pact-foundation/pact-cli#154 ·
メンテナーはふだん 3 日以内に返信