-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
downloader config from --experimental_downloader_config is cached in the server and requires shutdown to change #24166
Comments
I did a deeper manual bisect and it appears to have been introduced in cab54be (relative to a git bisect between 7.3.2 and 7.4.0) |
@bazel-io fork 7.4.1 |
@bazel-io fork 8.0.0 |
Thanks for the bisect and ping, I'll see if I can whip up an easy patch for this. |
Okay I need some help here, as I've never worked with the This bug is as far as I can see only applicable to bzlmod registry access, and not to general URLs.
Does this analysis help someone from the bazel core team to come up with a patch for this issue? |
I think that this root cause analysis is spot-on, thanks! How we fix this depends on the semantics we want to achieve:
|
I think the problem goes further - the other options from RepoOptions that affect the download manager are also cached for bzlmod downloads - updates to the max parallel downloads option are as far as I can see by a quick look also ignored. If there's a chance that the registry is used in parallel with other stuff, then we have two download managers active at the same time that don't share the same underlying semaphore in the httpdownloader, which in theory is also a correctness problem. So injecting DownloadManagers into registry instances seems reasonable to me, as we otherwise break the assumption that the DownloadManager is command-scoped. |
Speaking as a Bazel user here, I do not want an entry in the cache to mask an error in a modified downloader config. So I'd want a change in the downloader config to invalidate all downloads. |
This is pretty tricky as the repo cache isn't aware of downloader config rewrites. So even if we make the Bzlmod SkyFunctions dependent on them, you could still get cache hits if your config is invalid. We could add new logic to rewrite URL-like canonical IDs using the rewriter, but that's more of a FR than a bug fix. |
@criemen Would you be willing to send a PR to inject |
@fmeum I'll give it a timeboxed try this afternoon. |
PR here: #24212 |
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
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
…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]>
A fix for this issue has been included in Bazel 7.4.1 RC2. Please test out the release candidate and report any issues as soon as possible. |
…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]>
Description of the bug:
The value of
--experimental_downloader_config
seems to be cached in the server on startup and requires a shutdown in order to change either the value of the flag or the contents of the file that the flag points to.Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?release 8.0.0rc2
andrelease 7.4.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
bazelisk doesn't support this use case, but I manually bisected release versions, and this appears to be a regression. The bug is present in:
The bug is not present in:
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: