Issue was caused by worker threads updating nodes valency at the same time while we're filling the queue with "root" nodes (leaf nodes which don't depend on others).
Issue was caused by worker threads updating nodes valency at the same time while we're filling the queue with "root" nodes (leaf nodes which don't depend on others).