Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in activity dependent discovery management #6

Open
michaelroland opened this issue Apr 10, 2020 · 0 comments
Open

Race condition in activity dependent discovery management #6

michaelroland opened this issue Apr 10, 2020 · 0 comments
Assignees

Comments

@michaelroland
Copy link

If the SDK detects an activity transition to STILL (device not moving) it starts a disable delay timeout (10 minutes) before it actually disables discovery (stopDetectionDelayed()). If the device then transitions to another state (e.g. walking), it issues an immediate startDetection() command. If that happens before the 10 minute timeout is over, the delay timeout (handled by a seperate thread) will still continue to run and will disable discovery once expired, even if the user still walking around.

Example 1 (no problem)

  • Device is WALKING.
  • Device transitions to STILL: stopDetectionDelayed() is called and timeout starts counting down
  • Device continues to be STILL for 10 minutes: CountdownThreadHandler invokes stopDetection() and discovery/broadcasting stops
  • Device transitions to WALKING: startDetection() is called, the discovery starts and will continue to run (no problem)

Example 2 (malfunction)

  • Device is WALKING.
  • Device transitions to STILL: stopDetectionDelayed() is called and timeout starts counting down
  • After 9 minutes, device transitions to WALKING: startDetection() is called and the discovery starts
  • One minute later: CountdownThreadHandler invokes stopDetection() and discovery/broadcasting stops (eventhough device is still WALKING)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants