diff options
author | mschaller <mschaller@google.com> | 2018-06-28 11:53:36 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-28 11:55:30 -0700 |
commit | a8926b7010f7bbbe6e1d9b558bac88b73be28250 (patch) | |
tree | ff7d2e2a7a89b1de404b8881abc9ce58d4ab4045 /src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java | |
parent | e25edb1e8f5bfd4c2e6d7cc068567c35dd48db7b (diff) |
Convert directDeps to a map of SkyValues
SkyFunctionEnvironment only cares about directDeps' values, not other
NodeEntry data.
This reduces the space of code which could be sensitive to nodes which
transition from done to dirty during evaluation.
To prevent check-then-act races in the refactored code (and only there;
other code will be fixed in future refactorings), instead of checking
deps' isDone() methods before accessing their value, allow
getValueMaybeWithMetadata to be called when not done, and have it return
null when not done.
(Note that done->dirty node transitions during evaluation are planned,
but not yet possible.)
RELNOTES: None.
PiperOrigin-RevId: 202518781
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java index b607e2fa20..abca3b25c4 100644 --- a/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java +++ b/src/main/java/com/google/devtools/build/skyframe/AbstractParallelEvaluator.java @@ -424,20 +424,10 @@ public abstract class AbstractParallelEvaluator { } } - Map<SkyKey, ? extends NodeEntry> newlyRequestedDeps = - evaluatorContext.getBatchValues( - skyKey, Reason.DONE_CHECKING, env.getNewlyRequestedDeps()); - boolean isTransitivelyTransient = reifiedBuilderException.isTransient(); - for (NodeEntry depEntry : - Iterables.concat(env.getDirectDepsValues(), newlyRequestedDeps.values())) { - if (!isDoneForBuild(depEntry)) { - continue; - } - ErrorInfo depError = depEntry.getErrorInfo(); - if (depError != null) { - isTransitivelyTransient |= depError.isTransitivelyTransient(); - } - } + boolean isTransitivelyTransient = + reifiedBuilderException.isTransient() + || env.isAnyDirectDepErrorTransitivelyTransient() + || env.isAnyNewlyRequestedDepErrorTransitivelyTransient(); ErrorInfo errorInfo = evaluatorContext.getErrorInfoManager().fromException( skyKey, reifiedBuilderException, |