android / android/performance-samples

JankStatsAggregator.issueJankReport concurrency issues

オープン
#309 コメント 1 件 リアクション 1 件 担当者 1 名 @AjeshRPai が担当を希望しています GitHub で見る
主要言語
Kotlin
スター
1.4k
フォーク
250
平均マージ
9分
マージ済み PR(30日)
4

説明

The example JankStatsAggregator class can produce `ConcurrentModificationException` for listeners that perform some additional operations on it. Presumably because of how FrameData objects are internally mutated.

It appears that JankStatsAggregator.issueJankReport attempts to account for that with copies, but it may not be fully thread safe.

For example:

```
private val reportListener = JankStatsAggregator.OnJankReportListener { _, _, jankFrameData ->
jankFrameData.filter(...).map { frame ->
// Do something with FrameData and/or StateInfo
}
}
```

This usage results in rare concurrency exceptions. I'm not sure if it is a misusage on my end, but as a user I would expect the listener to be thread safe.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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