Verify correct execution order of Components with Variadic
input type and greediness
#7873
Labels
2.x
Related to Haystack v2.0
P2
Medium priority, add to the next sprint if no P1 available
topic:core
This issue stems from this comment in PR #7849.
While refactoring
Pipeline.run()
for #7614 we stumbled upon a confusing issue with Components that have at least an input of typeVariadic
and also are marked as "greedy" with theis_greedy
argument of the@component
decorator.We noticed that those Components when receiving inputs would be removed from the execution queue (
to_run
) and the queue for those Components that are waiting for inputs (waiting_for_input
), and only then added back at the back of the execution queue (to_run
). Though the previous version of the comment related to that snippet implied that the Component is put on TOP of the execution queue (to_run
).Changing that snippet to put the Component with
Variadic
input type andis_greedy
set toTrue
on top of the queue instead of the back doesn't make any of our tests fail. Also changing it to only put the Component in the back of the execution queue only if it's not already there doesn't make any test fail.As of now we're unsure whether changing this behaviour would break any existing use case.
After some discussion with @masci and @shadeMe we decided to keep the current behaviour and update the comment I mentioned above to reflect the current behaviour to avoid breaking anything and mopen an issue to track this and investigate a bit more.
This issue is also related to #7871.
The text was updated successfully, but these errors were encountered: