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

[7.1.0] Don't use worker threads for repo fetching during Skyframe er… #21305

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ public RepositoryDirectoryValue.Builder fetch(
Map<String, String> markerData,
SkyKey key)
throws RepositoryFunctionException, InterruptedException {
if (workerExecutorService == null) {
if (workerExecutorService == null
|| env.inErrorBubblingForSkyFunctionsThatCanFullyRecoverFromErrors()) {
// Don't use the worker thread if we're in Skyframe error bubbling. For some reason, using a
// worker thread during error bubbling very frequently causes deadlocks on Linux platforms.
// The deadlock is rather elusive and this is just the immediate thing that seems to help.
// Fortunately, no Skyframe restarts should happen during error bubbling anyway, so this
// shouldn't be a performance concern. See https://github.com/bazelbuild/bazel/issues/21238
// for more context.
return fetchInternal(rule, outputDirectory, directories, env, markerData, key);
}
var state = env.getState(RepoFetchingSkyKeyComputeState::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ default void injectVersionForNonHermeticFunction(Version version) {}
* may be called upon to transform a lower-level exception. This method can tell it whether to
* transform a dependency's exception or ignore it and return a value as usual.
*/
// TODO: Rename this as it can be called for other purposes.
boolean inErrorBubblingForSkyFunctionsThatCanFullyRecoverFromErrors();

/**
Expand Down
Loading