Flaky: concurrent_hard_miss_errors_are_returned_to_each_caller can count two loader calls

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

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

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

評価

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

調査の方向性

crates/cache/src/tests.rs、特に concurrent_hard_miss_errors_are_returned_to_each_caller とそのランタイム設定から始めてください。一時停止された時間と起動したタスクが、loader のスリープとどのように相互作用するかを確認してください。loader が完了する前に8つすべての呼び出し元が進行中のエントリに到達するようテストを調整し、loader の呼び出しが1回であることと、すべての呼び出し元がエラーを受け取ることを引き続き検証していると確認してください。

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

説明

crates/cache/src/tests.rs, concurrent_hard_miss_errors_are_returned_to_each_caller, failed in the mongodb-rust job of PR #970, a change to one docs file (job 133779105987, 17 November 02:55 UTC):

thread 'tests::concurrent_hard_miss_errors_are_returned_to_each_caller' panicked at crates/cache/src/tests.rs:850:5:
assertion `left == right` failed: 8 concurrent hard-miss callers must collapse to exactly one loader call
  left: 2
 right: 1

The test spawns 8 tasks that each call cache.get("k"). The loader sleeps 30 ms and returns an error, and errors are not cached. A task that first runs after the first loader call ended finds no single-flight entry and starts a second call. On a loaded runner a spawned task can start more than 30 ms late, so the count of 2 needs no defect in the cache.

Fix: the test runs on a multi-thread runtime (flavor = "multi_thread", worker_threads = 4). On a current-thread runtime with start_paused = true, the clock advances only when every task waits, so all 8 calls reach the in-flight entry before the loader's sleep ends. If the test must keep the multi-thread runtime, a loader sleep far above a runner's scheduling delay makes the second call unlikely, not impossible.

主要言語
Rust
スター
517
フォーク
60
平均マージ
5日 14時間
マージ済み PR(30日)
124

環境構築

はじめの一歩

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

ExtendDB/extenddb のほかの issue

ExtendDB/extenddb の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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