Fix sporadic hangs in FG buffering node tests#2102
Open
kboyarinov wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses sporadic hangs in several flow-graph “buffering node” tests by centralizing and strengthening the spin_try_get helper so tests reliably trigger execution of pending graph tasks instead of assuming a worker will pick them up.
Changes:
- Move/centralize
spin_try_getintotest/common/graph_utils.h, adding a wakeup workaround viaoneapi::tbb::this_task_arena::enqueueafter prolonged spinning. - Remove per-test local
spin_try_getimplementations from buffering-node test sources and rely on the shared helper. - Update test file copyright headers.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/common/graph_utils.h | Adds shared spin_try_get with a task-enqueue workaround to avoid missed wakeups/hangs. |
| test/tbb/test_buffer_node.cpp | Removes local spin_try_get and uses the shared helper. |
| test/tbb/test_queue_node.cpp | Removes local spin_try_get (including the old workaround) and uses the shared helper. |
| test/tbb/test_priority_queue_node.cpp | Removes local spin_try_get and uses the shared helper. |
| test/tbb/test_sequencer_node.cpp | Removes local spin_try_get; needs an include fix to use the shared helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1029
to
+1030
| // This workaround assumes the calling thread is in the graph arena and all | ||
| // task elements are submitted to the graph before calling spin_try_get. |
Contributor
There was a problem hiding this comment.
Can we add an assert or something that will protect us at least from being outside of any arena. For example, consider:
Suggested change
| // This workaround assumes the calling thread is in the graph arena and all | |
| // task elements are submitted to the graph before calling spin_try_get. | |
| // This workaround assumes the calling thread is in the graph arena and all | |
| // task elements are submitted to the graph before calling spin_try_get. | |
| CHECK(oneapi::tbb::this_task_arena::current_thread_index() != | |
| oneapi::tbb::this_task_arena::not_initialized, "Expected to be within an arena"); |
aleksei-fedotov
previously approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adopt workaround from test_queue_node for other buffering node types.
The existing tests are a bit incorrect to assume TBB worker will come and pick up some internal tasks that are spawned, which is not guaranteed by TBB scheduler.
After a huge amount of checks in spin_try_get, enqueue a task that is guaranteed to execute
Fixes #1467
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@to send notificationsOther information