-
-
Notifications
You must be signed in to change notification settings - Fork 637
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 algorithm for gathering Go build requests with coverage. #20030
Merged
Conversation
This file contains 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
To see this, consider that each iteration of the algorithm removes one package from the head of the queue, and adds all its direct deps to the end of the queue. Let's assume for simplicity that we have dependency chains of depth 8 and that each package has 10 direct deps (other than leaf packages which have no deps at all). We will get to a queue of ~10^8 elements. |
tdyas
approved these changes
Oct 15, 2023
WorkerPants
pushed a commit
that referenced
this pull request
Oct 15, 2023
The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case.
WorkerPants
pushed a commit
that referenced
this pull request
Oct 15, 2023
The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case.
WorkerPants
pushed a commit
that referenced
this pull request
Oct 15, 2023
The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case.
benjyw
added a commit
that referenced
this pull request
Oct 16, 2023
…pick of #20030) (#20032) The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case. Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
benjyw
added a commit
that referenced
this pull request
Oct 16, 2023
…pick of #20030) (#20033) The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case. Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
benjyw
added a commit
that referenced
this pull request
Oct 16, 2023
…pick of #20030) (#20031) The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case. Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
benjyw
added a commit
that referenced
this pull request
Dec 24, 2023
The previous algorithm did not check if a package had already been traversed, which leads to exponential blowup of the queue. Go doesn't support dependency cycles, so the previous algorithm would converge eventually, but before it did so the queue could get to sizes that were infinite in practice. This happened in a real-world case. This is an identical fix to the one in #20030, which was for coverage build requests. These are the only two places in the go backend (that I can find) where a transitive walk like this is done.
benjyw
added a commit
that referenced
this pull request
Dec 24, 2023
The previous algorithm did not check if a package had already been traversed, which can lead to exponential blowup of the queue. This is an identical fix to the one in #20030, which was for coverage build requests. These are the only two places in the go backend (that I can find) where a transitive walk like this is done. Unlike #20030 this one is not known to have caused a problem for any users in practice.
alonsodomin
pushed a commit
to alonsodomin/pants
that referenced
this pull request
Dec 28, 2023
The previous algorithm did not check if a package had already been traversed, which can lead to exponential blowup of the queue. This is an identical fix to the one in pantsbuild#20030, which was for coverage build requests. These are the only two places in the go backend (that I can find) where a transitive walk like this is done. Unlike pantsbuild#20030 this one is not known to have caused a problem for any users in practice.
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.
The previous algorithm did not check if a package had already been
traversed, which leads to exponential blowup of the queue.
Go doesn't support dependency cycles, so the previous algorithm
would converge eventually, but before it did so the queue could get
to sizes that were infinite in practice. This happened in a real-world
case.