polarofficial / polar-ble-sdk

Repository includes SDK and code examples. More info https://polar.com/en/developers
Other
449 stars 147 forks source link

Application is Hanging, Not Receiving ECG callback, API is Running #333

Closed KennethEvans closed 1 year ago

KennethEvans commented 1 year ago

Platform on which you observed the bug:

Device on which you observed the bug:

I have been working on this problem for a long time. It usually happens when I am not attached to the computer.

Today I managed to catch it while in Android Studio. The API is still running and logging messages continually, but I am not getting the callback. The API messages do not mean much to me, and I am attaching the output from the Run window in a text file. I am also attaching the relevant code in a text file.

It has been working for a long time. This problem is intermittent. It causes me to lose important data when it happens.

I was able to attach to the process. I do not see any locked threads, but there is little I can do beyond that. It is using Android Plot, which has internal thread locking, but the three plot thread are in WAIT. I am pretty sure sure I am handling the locking and unlocking correctly. (Usually it works.)

Ke-Net-2023-02-20-Hang.txt Ke-Net-2023-02-20-Code.txt

KennethEvans commented 1 year ago

I believe I have finally found the cause of this intermittent handing. (After over a year.) It seems to be a race condition inside AndroidPlot. I am now pretty sure it is not the SDK, so I am closing this.