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

Thread deadlock encountered when using BNO055 #397

Open
bruno-f-cruz opened this issue Jan 10, 2025 · 0 comments
Open

Thread deadlock encountered when using BNO055 #397

bruno-f-cruz opened this issue Jan 10, 2025 · 0 comments

Comments

@bruno-f-cruz
Copy link

Heya!

Following a chat with @bparks13...

When using the library with a custom Bonsai workflow (repository is here, but let me know i you have any questions), we have encountered a thread deadlock after running long acquisition sessions (>4hours). From the point of view of bonsai, the lock manifest itself as something that stops the update of all visualizers and prevents the "stop" button from being pressed.

After making a quick memory dump from the process while in its frozen state, I realized that one of the threads that was locked was the one used by the PolledBNO055Data operator. (I am happy to provide the mem dump if you want, but its quite a large file (2gb).)

In the meantime, I tried a solution that seems to have fixed it (or at least no crashes so far, including a full 12hour, 0 twisted turns on the wire, session :P)

Going through the source of the operator (

var source = Observable.Interval(TimeSpan.FromMilliseconds(10), new NewThreadScheduler());
), I noticed that the 0-argument overload is instantiating a NewScheduler. As I have had trouble with these before, I instead used the second overload with a Timer (which by default uses the DefaultScheduler, if I am not mistaken). This change has been sufficient to stop the deadlocks so far.

Hope it helps!

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

1 participant