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

No longer eagerly fetch labels in repo rule attributes #23371

Closed
wants to merge 2 commits into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Aug 20, 2024

Eager fetching of all labels listed in repo rule attributes was introduced as a performance optimization to avoid costly restarts.

Now that restarts are gone by default, this is no longer a benefit as it can cause unnecessary fetches and also create cycles where there wouldn't be any without this behavior (e.g. when two repos write each others labels into a file without resolving them).

Work towards #19055

Eager fetching of all labels listed in repo rule attributes as introduced as a performance optimization when to avoid restarts. Now that restarts are gone by default, this is no longer a benefit as it can cause unnecessary fetches and also create cycles where there wouldn't be any without this behavior (e.g. when two repos write each others labels into a file without resolving them).
@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 Aug 20, 2024
@fmeum
Copy link
Collaborator Author

fmeum commented Aug 20, 2024

@bazel-io fork 7.4.0

@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 Aug 20, 2024
@fmeum fmeum requested a review from Wyverald August 20, 2024 21:09
@fmeum
Copy link
Collaborator Author

fmeum commented Aug 20, 2024

I fixed and deleted tests.

@dzbarsky
Copy link

We still have restarts for extensions, right? If an extension instantiates a repo rule, how does this affect it?

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 21, 2024

We still have restarts for extensions, right? If an extension instantiates a repo rule, how does this affect it?

We still have restarts for extensions, but their label attributes have never been fetched eagerly. Since repo rules are run lazily when needed, not inline when called by an extension, they will always be free of restarts even with this change.

@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 Aug 21, 2024
@fmeum fmeum deleted the 19055-eager-repo-fetch branch August 21, 2024 09:07
fmeum added a commit to fmeum/bazel that referenced this pull request Aug 22, 2024
Eager fetching of all labels listed in repo rule attributes was introduced as a performance optimization to avoid costly restarts.

Now that restarts are gone by default, this is no longer a benefit as it can cause unnecessary fetches and also create cycles where there wouldn't be any without this behavior (e.g. when two repos write each others labels into a file without resolving them).

Work towards bazelbuild#19055

Closes bazelbuild#23371.

PiperOrigin-RevId: 665744319
Change-Id: Ia27f207793a2da3fb8e37743b328483f9d45192c
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
Development

Successfully merging this pull request may close these issues.

3 participants