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

Remove DownloadManager instance from RegistryFactoryImpl. #24212

Closed
wants to merge 1 commit into from

Conversation

criemen
Copy link
Contributor

@criemen criemen commented Nov 5, 2024

This PR removes the DownloadManager from the registry factory implementation. As the registry created by the factory is cached by the SkyFunction mechanism, the DownloadManager instance was living too long - it is supposed to be re-created for every command instantiation to respect changes in command line options, but for the registry, it ignored those changes.

Instead, the DownloadManager is set directly into the affected SkyFunctions that require access to it. This way, the per-command DownloadManager instance is correctly used.

This fixes #24166.

Note for reviewers: This is my first time touching code with SkyFunctions, so I don't really know what I'm doing.

This PR removes the DownloadManager from the registry factory implementation.
As the registry created by the factory is cached by the SkyFunction mechanism,
the DownloadManager instance was living too long - it is supposed to be
re-created for every command instantiation to respect changes in command line options,
but for the registry, it ignored those changes.

Instead, the DownloadManager is set directly into the affected SkyFunctions that
require access to it. This way, the per-command DownloadManager instance is
correctly used.
@criemen criemen marked this pull request as ready for review November 5, 2024 16:11
@criemen
Copy link
Contributor Author

criemen commented Nov 5, 2024

CC @fmeum for pre-review if you want

@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Nov 5, 2024
Copy link
Collaborator

@fmeum fmeum left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@Wyverald Wyverald added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Nov 5, 2024
@copybara-service copybara-service bot closed this in f57f672 Nov 6, 2024
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Nov 6, 2024
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Nov 6, 2024
This PR removes the DownloadManager from the registry factory implementation. As the registry created by the factory is cached by the SkyFunction mechanism, the DownloadManager instance was living too long - it is supposed to be re-created for every command instantiation to respect changes in command line options, but for the registry, it ignored those changes.

Instead, the DownloadManager is set directly into the affected SkyFunctions that require access to it. This way, the per-command DownloadManager instance is correctly used.

This fixes bazelbuild#24166.

Note for reviewers: This is my first time touching code with SkyFunctions, so I don't really know what I'm doing.

Closes bazelbuild#24212.

PiperOrigin-RevId: 693644409
Change-Id: I7b16684e52673043615290d114f078ab7ab99fcf
meteorcloudy pushed a commit to meteorcloudy/bazel that referenced this pull request Nov 6, 2024
This PR removes the DownloadManager from the registry factory implementation. As the registry created by the factory is cached by the SkyFunction mechanism, the DownloadManager instance was living too long - it is supposed to be re-created for every command instantiation to respect changes in command line options, but for the registry, it ignored those changes.

Instead, the DownloadManager is set directly into the affected SkyFunctions that require access to it. This way, the per-command DownloadManager instance is correctly used.

This fixes bazelbuild#24166.

Note for reviewers: This is my first time touching code with SkyFunctions, so I don't really know what I'm doing.

Closes bazelbuild#24212.

PiperOrigin-RevId: 693644409
Change-Id: I7b16684e52673043615290d114f078ab7ab99fcf
meteorcloudy added a commit that referenced this pull request Nov 6, 2024
…4228)

This PR removes the DownloadManager from the registry factory
implementation. As the registry created by the factory is cached by the
SkyFunction mechanism, the DownloadManager instance was living too long
- it is supposed to be re-created for every command instantiation to
respect changes in command line options, but for the registry, it
ignored those changes.

Instead, the DownloadManager is set directly into the affected
SkyFunctions that require access to it. This way, the per-command
DownloadManager instance is correctly used.

This fixes #24166.

Note for reviewers: This is my first time touching code with
SkyFunctions, so I don't really know what I'm doing.

Closes #24212.

PiperOrigin-RevId: 693644409
Change-Id: I7b16684e52673043615290d114f078ab7ab99fcf

Co-authored-by: Cornelius Riemenschneider <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2024
…4220)

This PR removes the DownloadManager from the registry factory
implementation. As the registry created by the factory is cached by the
SkyFunction mechanism, the DownloadManager instance was living too long
- it is supposed to be re-created for every command instantiation to
respect changes in command line options, but for the registry, it
ignored those changes.

Instead, the DownloadManager is set directly into the affected
SkyFunctions that require access to it. This way, the per-command
DownloadManager instance is correctly used.

This fixes #24166.

Note for reviewers: This is my first time touching code with
SkyFunctions, so I don't really know what I'm doing.

Closes #24212.

PiperOrigin-RevId: 693644409
Change-Id: I7b16684e52673043615290d114f078ab7ab99fcf

Commit
f57f672

Co-authored-by: Cornelius Riemenschneider <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
3 participants