aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe
Commit message (Collapse)AuthorAge
* Also report stored posts further up in SkyframeGravatar Klaus Aehlig2017-05-31
| | | | | | | | | | As SkyFunctions are supposed to be restartable, e.g., if prerequisites are missing, events generated by them are temporarily stored. So are BuildEvents posted by them. However, once the evaluation of a SkyFunction is finalized, the stored posts need to be reposted. Do this. Change-Id: I4ce20266fbfcbb298e93eb53086fa9916874f5d8 PiperOrigin-RevId: 157575119
* Avoid waste in registerNewlyDiscovered... when there aren't anyGravatar mschaller2017-05-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 156553687
* Add a EvaluationProgressReceiver#computing method.Gravatar nharmata2017-05-11
| | | | | RELNOTES: None PiperOrigin-RevId: 155665128
* Introduce CompoundEvaluationProgressReceiver for combining multiple ↵Gravatar nharmata2017-05-10
| | | | | | | EvaluationProgressReceivers. RELNOTES: None PiperOrigin-RevId: 155542146
* Introduce an EvaluationProgressReceiver implementation that does nothing.Gravatar nharmata2017-05-10
| | | | | | | | This is useful for dealing with all the existing implementations in the face of interface changes that are irrelevant. RELNOTES: None PiperOrigin-RevId: 155525021
* Clean up AbstractQueueVisitor's constructors.Gravatar janakr2017-05-09
| | | | | | | | The "concurrent" bit was supposedly around for testing purposes, but who knows if it even works anymore. Making other callsites explicitly state their ErrorClassifier gets us down to two constructors, one of which can delegate to the other. I think having both these constructors is useful because there's a linkage between creating a new executor service and specifying that the AQV should shut down the service at the end of the visitation. And using a static create() method doesn't work because of AQV's inheritance model. PiperOrigin-RevId: 155406771
* Make SkyKey an interface, and start the migration of not creating SkyKey ↵Gravatar janakr2017-05-04
| | | | | | wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries. PiperOrigin-RevId: 154989520
* Allow graph implementations to filter out deps that are known to be done ↵Gravatar janakr2017-04-10
| | | | | | when change pruning. This can speed up change pruning. PiperOrigin-RevId: 152538144
* Drop loading-phase values if --discard_analysis_cache is true and we're not ↵Gravatar janakr2017-03-31
| | | | | | keeping incremental state. PiperOrigin-RevId: 151639711
* Remove BuildingState, since it only has one field. Instead, keep the ↵Gravatar Janak Ramakrishnan2017-03-27
| | | | | | | | | | signaledDeps field directly in InMemoryNodeEntry. Should save ~24 bytes per freshly evaluating node entry (I haven't calculated object alignment for InMemoryNodeEntry now, so could be more or less). Also might save some memory for re-evaluating node entries, since the BuildingState class had to be padded out to a multiple of 8 bytes before the DirtyBuildingState fields could start. Don't actually know if that was happening. -- PiperOrigin-RevId: 151138224 MOS_MIGRATED_REVID=151138224
* Stop storing reverse deps to signal in BuildingState. Instead, re-use the ↵Gravatar Janak Ramakrishnan2017-03-24
| | | | | | | | | | | | | | reverseDepsToConsolidate field in InMemoryNodeEntry. As part of that, revamp our logic of how we store pending operations: store adds bare on initial evaluations, and checks bare on incremental evaluations and operations on done nodes. This should improve performance in two ways: BuildingState loses two fields, saving working memory intra-build. Storing pending reverse dep operations bare also saves memory intra-build. Note that neither of these changes helps resting memory state, only while a node is still evaluating. Because of this, we can simplify ReverseDepsUtil a bit, making ReverseDepsUtilImpl a static class, which it always wanted to be (what it really wants to be is a superclass of InMemoryNodeEntry, but I don't want to spend the object alignment bits). Finally, this makes it pretty tempting to get rid of BuildingState altogether on initial evaluations. We'd still keep DirtyBuildingState, but we could save another ~24 bytes by storing BuildingState's one remaining field, signaledDeps, directly inside InMemoryNodeEntry. -- PiperOrigin-RevId: 151048879 MOS_MIGRATED_REVID=151048879
* Tighten invariants around dirtiness checking. We should never need to create ↵Gravatar Janak Ramakrishnan2017-03-06
| | | | | | | | a child that's being checked by a parent (that was a legacy of when we delegated to enqueueChild), and such a child that is being checked should always be dirty or done, never fresh. -- PiperOrigin-RevId: 149136909 MOS_MIGRATED_REVID=149136909
* Add some more debugging info in case of rdep inconsistencies in Skyframe -- ↵Gravatar Janak Ramakrishnan2017-03-03
| | | | | | | | the full list of rdep mods that are being performed on this entry, not just the current one that failed. -- PiperOrigin-RevId: 149055655 MOS_MIGRATED_REVID=149055655
* In SkyFunctionEnvironment post progress-like events immediately Gravatar Klaus Aehlig2017-02-28
| | | | | | | | | | | | | In Skyframe Evaluation, events reporting about progress are meant to be seen immediately by the environment. More over, they are not to be replayed when taking this SkyFunction out of cache. So change the custom implementation of the StoredEventHandler in the SkyFunctionEnvironment to forward appropriately. -- Change-Id: I30baf0088595ef684f16270f11668e980e65aa41 Reviewed-on: https://cr.bazel.build/9112 PiperOrigin-RevId: 148766400 MOS_MIGRATED_REVID=148766400
* Provide more reporting options to SkyFunctions Gravatar Klaus Aehlig2017-02-27
| | | | | | | | | | | | | With more specific information to be reported by Skyfunctions, e.g., to inform the build-event protocol on missing files, the EventHandler interface is no longer enough. Therefore, provide an enriched context for reporting events. -- Change-Id: I2d06166fe4d5b9054e24ad8c752fafc039e3f9f8 Reviewed-on: https://cr.bazel.build/8794 PiperOrigin-RevId: 148463437 MOS_MIGRATED_REVID=148463437
* Inform progress receiver that node has been computed before any exception ↵Gravatar Janak Ramakrishnan2017-02-13
| | | | | | | | handling. -- PiperOrigin-RevId: 147185674 MOS_MIGRATED_REVID=147185674
* Add "CLEAN_UP" as a reason for retrieving a node.Gravatar Shreya Bhattarai2017-02-09
| | | | | | -- PiperOrigin-RevId: 146982656 MOS_MIGRATED_REVID=146982656
* Refactor DirtyBuildingState to allow custom implementation on storing theGravatar Googler2017-02-01
| | | | | | | | dependencies used in last build -- PiperOrigin-RevId: 146169454 MOS_MIGRATED_REVID=146169454
* Fix an issue with cached EventHandlers in SkyQueryEnvironment's resolverGravatar Mark Schaller2017-01-23
| | | | | | | | | | | | Because the event handler's inner handlers are removed after each query command, caching the handler caused a subset of subsequent commands' errors (those reported through the resolver's handler) to go unlogged. Also fix a bug with cycle detection in DelegatingWalkableGraph. -- PiperOrigin-RevId: 145124271 MOS_MIGRATED_REVID=145124271
* Add some logging in case we fail an evaluation. This should be generally ↵Gravatar Janak Ramakrishnan2017-01-13
| | | | | | | | useful, but may also help identify Bazel as the culprit in the linked bug if we're lucky and the timestamps are clear. -- PiperOrigin-RevId: 144359628 MOS_MIGRATED_REVID=144359628
* Unsynchronize InMemoryNodeEntry#isDone. The buildingState variable's state ↵Gravatar Shreya Bhattarai2017-01-09
| | | | | | | | changes are visibile to all other threads by volatility and we don't read the variable at any intermediate or inconsistent state (simply check against null or a constant). reverseDepsToSignal is also made volatile for subclasses that need volatile reads to it. -- PiperOrigin-RevId: 143787032 MOS_MIGRATED_REVID=143787032
* Remove WalkableGraph#exists and allow WalkableGraph#getValue and ↵Gravatar Janak Ramakrishnan2017-01-03
| | | | | | | | WalkableGraph#getException to be given non-existent keys without crashing. Add WalkableGraph#isCycle to fill the gap in testing for the difference between non-existence and depending on a cycle. -- PiperOrigin-RevId: 143205289 MOS_MIGRATED_REVID=143205289
* Global cleanup change.Gravatar Googler2016-12-07
| | | | | | -- PiperOrigin-RevId: 141307853 MOS_MIGRATED_REVID=141307853
* Introduce BlazeInterners, a Blaze-specific wrapper around Guava's Interners ↵Gravatar Nathan Harmata2016-11-24
| | | | | | | | | | | that makes an appropriate call to Interners.InternerBuilder#concurrencyLevel. For current readers of this CL, I used this class everywhere in the Blaze codebase. For future readers of this CL, this class should be used to create an Interner in the Blaze codebase. -- MOS_MIGRATED_REVID=140063271
* Cache all previously computed values in ↵Gravatar Janak Ramakrishnan2016-11-17
| | | | | | | | | SkyQueryEnvironment#beforeEvaluateQuery if possible to save on latency for small queries. This assumes that if the graph is up to date, then the data in SkyQueryEnvironment is also up to date. It also assumes that a ForkJoinPool remains usable until #shutdownNow is called. -- MOS_MIGRATED_REVID=139386363
* Re-use the precomputed universe key in WalkableGraphFactory#prepareAndGet.Gravatar Janak Ramakrishnan2016-11-17
| | | | | -- MOS_MIGRATED_REVID=139357569
* Add method getCurrentlyAvailableNodes to QueryableGraph and Walkable GraphGravatar Googler2016-10-31
| | | | | | | | | | It allows all graph implementations to return the list of nodes which are immediately available to be fetched. NOTE: Not-currently-available here does not mean the nodes do not exist in the graph. It simply means they are not ready to be fetched immediately yet. -- MOS_MIGRATED_REVID=137701432
* Rollback of commit e6191f7209ebf3f67480bc7aa9db5ac58beb2156.Gravatar Damien Martin-Guillerez2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll-forward with fix. Tested with `bazel build src:srcs //src/test/...` using a bootstrapped bazel. Fixes #1923. RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets. *** Original change description *** Automated [] rollback of commit a9f20b0d6459d395444c45cf5e94a899f3443633. *** Reason for rollback *** Broke Bazel CI: ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set. ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted. http://ci.bazel.io/view/Bazel%20b... *** -- MOS_MIGRATED_REVID=136589937
* Fix unnecessary static imports of typesGravatar Liam Miller-Cushon2016-10-18
| | | | | -- MOS_MIGRATED_REVID=136431274
* Stop storing a set in GroupedListHelper to deduplicate SkyKey dep requests. ↵Gravatar Janak Ramakrishnan2016-10-14
| | | | | | | Instead, deduplicate when the helper is actually added to a GroupedList. -- MOS_MIGRATED_REVID=136145321
* EvaluationProgressReceiver absorbs other progress trackers.Gravatar Chloe Calvarin2016-10-06
| | | | | | | | | | Remove DirtyKeyTracker and inflight node tracking as independent progress tracking bits of code, and instead use an internal-facing DirtyTrackingProgressReceiver wrapper of the user's EvaluationProgressReceiver. -- MOS_MIGRATED_REVID=135291924
* Fixed EvaluationProgressReceiver object namesGravatar Googler2016-09-27
| | | | | | | | | | EvaluationProgressReceiver objects have two common naming schemes currently, and calling them invalidationReceiver is misleading, so to make the naming convention standard, all object names are based on "progressReceiver." -- MOS_MIGRATED_REVID=134411011
* Introduce a Builder for ForkJoinQuiescingExecutor.Gravatar Nathan Harmata2016-09-21
| | | | | -- MOS_MIGRATED_REVID=133714902
* Allow reverse dependency lookups on Skyframe graph to throw InteruptedExceptionGravatar Googler2016-09-14
| | | | | -- MOS_MIGRATED_REVID=132999234
* Allow cycle detector to be injected into ParallelEvaluator, so that callers ↵Gravatar Janak Ramakrishnan2016-08-26
| | | | | | | can use different cycle detection algorithms if they wish. -- MOS_MIGRATED_REVID=131347160
* Factor out cycle detection.Gravatar Janak Ramakrishnan2016-08-26
| | | | | -- MOS_MIGRATED_REVID=131344134
* Refactor ParallelEvaluator in preparation for making it more modular with ↵Gravatar Janak Ramakrishnan2016-08-26
| | | | | | | | | | | respect to cycle checking. Reducing the size of ParallelEvaluator.java is also probably long overdue. I believe this change stands on its own, but if you don't think the third change is worth it, and this isn't worth it on its own, feel free to push back. -- MOS_MIGRATED_REVID=131340165
* Avoid copying SkyKeys into a set and then into a map when retrieving them. ↵Gravatar Janak Ramakrishnan2016-08-23
| | | | | | | | | | | | | Instead, just put them directly into a map. This avoids the memory churn and CPU cost of the set. As a result, we have to use HashMaps instead of ImmutableMap.Builders, which I hope is ok (especially since we're not keeping them around), and due to that, we have some nice nondeterminism in the returned order, which matters for some cycle-checking tests. Also, don't use a map at all when we don't need to (when building events). Note that, since we have to deduplicate at some point, this means that changing the return type of SkyFunction.Environment#getValues to not be a random-access map is probably not worth it. Changing the return type of ProcessableGraph#getBatch to not be a random access map might still be worthwhile, although it might require some funny operations. -- MOS_MIGRATED_REVID=131070418
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Have AQV propagate the most severe error encountered by any of its tasks. ↵Gravatar Nathan Harmata2016-08-12
| | | | | | | | | Make sure that ParallelEvaluator treats SchedulerExceptions as less severe than other RuntimeExceptions (it already did, but add a comment emphasizing this). The combination of the above means that we don't ignore hypothetical crashes in ParallelEvaluator worker threads _after_ a SchedulerException (e.g. due to an error in nokeep_going evaluation). -- MOS_MIGRATED_REVID=130044230
* Fix bug in ParallelEvaluator when an error dep was not newly requested in a ↵Gravatar Janak Ramakrishnan2016-08-11
| | | | | | | | | nokeep_going build because it finished building in between the time it was first requested and when we checked it for done-ness after the SkyFunction evaluation. This results in an IllegalStateException that gets ignored (and, importantly, not propagated) by AbstractQueueVisitor because AbstractQueueVisitor only records and propagates the first Throwable encountered. For nokeep_going evaluations, this will be the SchedulerException that we use for control flow. The IllegalStateException in question is benign in this case because it's merely from a Preconditions failure and doesn't leave anything in a bad state. It's possible, though, that we have other bugs that are being masked in this way. -- MOS_MIGRATED_REVID=129919336
* Get rid of InvalidatableGraph. This explicit concept is no longer needed.Gravatar Nathan Harmata2016-08-11
| | | | | -- MOS_MIGRATED_REVID=129895423
* Delete NodeEntryField since it's now superfluous in the presence of the new ↵Gravatar Nathan Harmata2016-08-03
| | | | | | | QueryableGraph.Reason which conveys more information. Add a few more Reason enum values to make this refactor benign. -- MOS_MIGRATED_REVID=129118462
* Augment the QueryableGraph#get[BatchWithFieldHints] method to take in ↵Gravatar Nathan Harmata2016-07-27
| | | | | | | parameters conveying the requesting node (if any), the requested node(s), as well as a reason for the skyframe graph lookup. Alternate graph implementations may be interested in this information. -- MOS_MIGRATED_REVID=128496089
* In keep-going mode, don't fail-fast on the evaluation of an individual ↵Gravatar Janak Ramakrishnan2016-07-12
| | | | | | | SkyFunction if it throws an exception but still has missing deps. Instead, pretend it didn't throw, and restart it when its known deps are all done, presumably to throw the same exception. This removes a basic source of non-determinism. -- MOS_MIGRATED_REVID=127129202
* Replace QueryableGraph#getBatch with #getBatchWithFieldHints. This allows ↵Gravatar Janak Ramakrishnan2016-07-11
| | | | | | | alternate graph implementations to optimize how they construct node entries. -- MOS_MIGRATED_REVID=126932020
* Refactor QueryableGraph and ThinNodeQueryableGraph to be independent ↵Gravatar Janak Ramakrishnan2016-07-11
| | | | | | | interfaces, in preparation for further changes. -- MOS_MIGRATED_REVID=126924789
* Refactor BuildingState to save memory.Gravatar Janak Ramakrishnan2016-07-07
| | | | | | | | | Collapse the "evaluating" boolean into the "signaledDeps" int field, since signaledDeps is always 0 if evaluating is false, so we can use the sentinel value -1 to indicate that evaluation has not yet started. This leads to a slightly less tolerant node entry: it must "start evaluating" before you can do things like set its value. Places that wasn't being done have been fixed, at least as far as we have test coverage for. Also, factor the "dirty" parts of BuildingState out into a subclass. It would probably be cleaner to use composition here, but I don't want to pay the price of another object. -- MOS_MIGRATED_REVID=126729331
* Re-use the InMemoryNodeEntry#directDeps field for temporary direct deps.Gravatar Janak Ramakrishnan2016-07-07
| | | | | | | The biggest savings here is that we were not eagerly discarding the InMemoryNodeEntry#directDeps field after an entry was marked dirty, even though we would never read its value again. But rather than just fix that, by getting rid of the field in BuildingState, we can potentially save memory with smaller BuildingState objects as well. -- MOS_MIGRATED_REVID=126709632
* Filter out already-removed deps when removing a node from the rdeps of its ↵Gravatar Janak Ramakrishnan2016-07-04
| | | | | | | last build's deps. This is only an issue with cycles, since there we try to maintain the invariant that a parent is not done before its children by removing its deps on its children before we construct its cycle value. -- MOS_MIGRATED_REVID=126494009