Skip to content
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

fix: Fix corner case when running Pipeline that causes it to get stuck in a loop #7531

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

silvanocerza
Copy link
Contributor

Proposed Changes:

With PR #7434 we introduced this bug that would cause a Pipeline to get stuck in an infinite loop when running if the following conditions are met:

  • The first Component has all defaults for its inputs
  • The first Component receives one input from the user
  • The first Component receives one input from a loop in the Pipeline
  • The second Component has at least one default input

This PR fixes this bug by making sure that a Component with defaults has all the necessary inputs to run when adding it in the to_run list when we notice we're stuck in a loop with Components that can still run.

How did you test it?

I added a unit test to reproduce the issue.

Notes for the reviewer

This bug has been discovered after this message on Discord.

Checklist

@silvanocerza silvanocerza added type:bug Something isn't working topic:core labels Apr 11, 2024
@silvanocerza silvanocerza added this to the 2.0.2 milestone Apr 11, 2024
@silvanocerza silvanocerza requested a review from masci April 11, 2024 09:53
@silvanocerza silvanocerza self-assigned this Apr 11, 2024
@silvanocerza silvanocerza requested a review from a team as a code owner April 11, 2024 09:53
@silvanocerza silvanocerza requested review from dfokina and removed request for a team April 11, 2024 09:53
@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 type:documentation Improvements on the docs labels Apr 11, 2024
@coveralls
Copy link
Collaborator

coveralls commented Apr 11, 2024

Pull Request Test Coverage Report for Build 8646811598

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 7 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.009%) to 89.934%

Files with Coverage Reduction New Missed Lines %
core/pipeline/pipeline.py 7 94.05%
Totals Coverage Status
Change from base Build 8643226904: 0.009%
Covered Lines: 6254
Relevant Lines: 6954

💛 - Coveralls

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

test/core/pipeline/test_pipeline.py Show resolved Hide resolved
haystack/core/pipeline/pipeline.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:core topic:tests type:bug Something isn't working type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants