Open jonsmirl opened 1 year ago
I can't tell you exactly as I haven't checked this issue, but it seems the 2 code locations below need to be changed.
Just looking at the log, it is judged that onServiceFound is called immediately after discoverServices, so it is thought that stopDiscoveryRunnable should be set first before discoverServices called.
@yunhanw-google @yufengwangca What is your opinion?
This bug appears to be some kind of small timing window. I can run this code hundreds of times and never hit this. Then I will hit it once. Then it will work again for another hundred times.
Not sure, but this seems to be correlated to bringing app out of the background up to foreground on Android. I was working on my app, I got a notice about important email, I looked at the email. Then I went back to CHIP app -- bang I hit it.
Have MDNS messages piled up while the CHIP app was in background, then when I brought it to foreground they were processed in this vulnerable window?
@sharadb-amazon any idea for this one?
Reproduction steps
Unknown what triggers this. I hit it a couple times a week.
This line "if (stopDiscoveryRunnable.cancel(false)) {" is not checking to ensure stopDiscoveryRunnable is not null first before using it.
Bug prevalence
2-3 times a week
GitHub hash of the SDK that was being used
bd17b9f52f41eeac5aaa74c1ecf3a76e06dd6958
Platform
android
Platform Version(s)
No response
Anything else?
No response