forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eagerly clean running nodes rather than interrupting them. (pantsbuil…
…d#18855) As reported in pantsbuild#10705: our current strategy for dirtying running nodes eagerly interrupts them, even if cleaning their dependencies might show that it is not necessary. In practice, this means that almost any file change in the repository will cause a run of pants to restart (most) of what it was doing. This change moves to dirtying running nodes (in `Entry::dirty`) by notifying them that their dependencies might have changed (via `AsyncValueSender.interrupt`, which is received in `spawn_node_execution`), and allowing them to attempt to clean the dependencies that they have observed so far. If the node determines that the dependencies it has observed so far are unchanged, it continues running without being interrupted: otherwise, it is canceled as it would have been before this change. Since dependency generations used to be collected lazily in `complete` (meaning that they weren't available to be used to clean a node _while_ it was running), pantsbuild#18835 made `graph::Context` concrete, and this change begins recording dependency generations on the concrete `Context` as they are requested by a node. This change fixes pantsbuild#10705, meaning that it should be possible to make edits to unrelated files in more cases, without causing running processes (e.g. those spawned by `test` or `run`) to restart. For example, try adding comments to relevant `BUILD` files while a test is running, and observe that it does not restart unless the edit impacts the inputs to the test run.
- Loading branch information
Showing
8 changed files
with
442 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.