Bonsai freezes and cannot stop workflow (or Bonsai) normally #2373
Replies: 2 comments 10 replies
-
|
First of all nice project organization! Awesome to see people using Bonsai.Sgen and pydantic for experiments :)! So I can help you, is there a minimal workflow that reproduces the issue? |
Beta Was this translation helpful? Give feedback.
-
|
Personally, I have exactly the same type of struggles with a complex setup making use of two Behavior boards, in which I am also implementing a condition checking how long an animal is poking before updating the state of the task. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I hope you are doing well.
My main Bonsai project consists on a sound lateralization task. It's nothing new, but the idea is to port the current setups to these ones centered around Harp and Bonsai. With that said, the project has already grown quite big, since it uses a lot of different hardware, it has a lot of constraints and configurations the user can pick from and it has a small GUI to display real-time data and interact with the task. The project is not finished by any means, but it's already possible to use in experiments, and it's in fact being used.
One issue that has been happening for a few months now is that the Bonsai workflow freezes and to stop it, I have to close the Bonsai window and kill the process. I've already tried a lot of stuff and honestly I don't know where to look at (or what to look at), so I'll just describe everything that I've tried and everything that I know about the setup, so I apologize in advance for this being a super long discussion.
The first thing I should mention is that this is not a consistent issue. It may happen 3 times in a setup in one day and then the next day it may not happen at all, with the exact same computer model (and remaining hardware) it may happen more in a setup than in another. The fact that it doesn't happen everytime makes it hard to find a cause and effect relationship.
The second thing is that the issue is not explicit. What I mean by that is that there's no error message, the camera keeps recording and I can still give reward to the animals (I could probably do a bunch of other things, but this is a thing I can do with the GUI). However, it's like the main task logic is not working anymore (and the fact that I indeed have to kill the process).
I've already tried to improve my Bonsai code, since I started the project a year ago and since then I think I improved my Bonsai knowledge. I tried to take the unnecessary logic out of the state machine, simplifying some of the logic, using some tricks I've learned along the way.
The majority of the reports I received related to this issue coincide with the end of the state machine and everytime I came across this issue it happened at the end of state machine. The best I could do regarding understanding what was happening was to see the final state send an event that is propagated to the last node, but for some reason the
Repeatnode doesn't trigger the resubscription process. I know that because when that happens the first node of the workflow (Timerwith the properties at 0 - so it sends anOnCompleteafter sending an event) doesn't send the event it would send if the resubscription process happened. To make sure that all states are terminated, every state has aTake 1in the end, so in principle the stream leading to theRepeatis more than terminated.I'm using Bonsai 2.8.2 and regarding hardware, I use a PointGrey/FLIR camera and the following Harp boards:
I've also set Windows configurations to use
Best Performanceand to never sleep/hibernate.However, when I need to develop something, I usually don't use the camera or the SyringePumps and it still may happen, so I doubt it's an issue related to any of these pieces of hardware. If it's helpful, you can find the documentation for the project here.
Thank you in advance for your help and let me know if there's something else I can explain/provide so that issue gets solved!
Beta Was this translation helpful? Give feedback.
All reactions