Pause Manager causes events not being uploaded on FlushAndTeardown
まだ誰も着手していません。
評価
調査の方向性
lib/api/LogManagerImpl.cpp の FlushAndTeardown から開始し、lib/tpm/TransmissionPolicyManager.cpp の PauseGuard 関連ロジックを調査します。maxTeardownUploadTimeInSec を 2–5 秒に設定して短時間で終了する testapp のケースを再現し、その後、teardown 中に保留中のリクエストが試行され、キャッシュが排出されるか設定時間が経過した後にアプリが終了することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Problem Description
It seems like a change from 2021 is affecting the FlushAndTeardown sequence:
https://github.com/microsoft/cpp_client_telemetry/pull/829
Steps to reproduce.
- Set
maxTeardownUploadTimeInSecto 2-3-5 seconds. - Run a very short-lived testapp.
- Observe the
FlushAndTeardownmethod spinning aimlessly and not actually uploading.
What is the expected behavior?
Expected behavior is that the 2-3 seconds are spent on trying to upload pending requests. Once there are zero events left, app should unblock and exit. Ideally with evt_stats event turned off, it should be relatively fast exit. Why need to turn evt_stats off - it's an oversubscribed event that'd generate 401/403, thus it's a waste. And should be removed out of the equation.
What is the actual behavior?
SDK spins and doesn't upload anything at the end of the run.
Additional context.
I suspect these pieces of code related to PauseGuard are causing the problem:
Because activity is paused here at the beginning of the FlushAndTeardown method, without actually waiting for events cache to be fully drained:
https://github.com/microsoft/cpp_client_telemetry/blob/0177277d1dc194a7703ca87d40587b6148608b45/lib/api/LogManagerImpl.cpp#L380
Instead of pausing - it's supposed to wait for the amount of time configured. Obviously FlushAndTeardown can't be called on mobile platforms on the main thread. It has to be called on the background thread. Calling this on foreground thread may cause ANR, and app getting killed.
The way it stands, it seems like short-lived apps and processes would experience "data loss", because their events get stuck and not attempted to be uploaded at the end of the short-lived app run.
- 主要言語
- C
- スター
- 102
- フォーク
- 66
- 平均マージ
- 3日 10時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/cpp_client_telemetry のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/cpp_client_telemetry#1333 ·
-
C API enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/cpp_client_telemetry#1504 ·
-
bug
microsoft/cpp_client_telemetry#1437 · 担当者 1 名 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
microsoft/cpp_client_telemetry#1413 · コメント 2 件 ·
microsoft/cpp_client_telemetry の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
corazawaf/coraza-nginx#140 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BasedHardware/omi#15662 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
level/task module/gcp type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100