-
Notifications
You must be signed in to change notification settings - Fork 1k
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
If a node marked as lightweight throws an exception, deadlock can occur. This should be documented or corrected #420
Comments
I have a suspicion what might go wrong. Can you tell please what value of concurrency do you specify for such a multifunction node? |
Please note that when exception is thrown the |
So the multifunction node was serial. The behavior observed was that the wait_for_all method never returned or threw an exception (it should throw an exception). Simply removing the lightweight mark made the behavior correct. I'll post a short reproduction shortly. |
Here's the reproduction. To make things simple, I just have two identical input nodes that both continually output 1 to an indexer node, which passes its output to a serial multifunction node marked lightweight. The multifunction node sleeps for 100ms just to ensure both input nodes have passed output to the indexer node, and then throws an exception. The flow graph hangs with the indexer node trying to pass output to the multifunction node forever, and Removing the lightweight designation causes behavior to become correct.
|
Thank you for the code, we were able to reproduce the described behavior on our side! Indeed, the implementation of the |
Great to hear, thanks! Just let me know if you need anything else. |
Looks like the issue was fixed by #623 but issue wasn't closed. Closing it. |
I had a very simple multifunction node that just translated incoming messages to outgoing messages that I had marked as lightweight. If the incoming message was non-sensical, it would throw an exception. When this happened, the graph would sometimes deadlock with the previous node trying to queue an incoming message to the lightweight node.
In hindsight, I can understand why an exception from a lightweight node might be problematic, but if it isn't something oneTBB wants to fix, it should be documented with warnings similar to the caution boxes at
https://spec.oneapi.com/versions/0.5.0/oneTBB/flow_graph/lightweight_policy.html
The text was updated successfully, but these errors were encountered: