-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure NamedSetOfFiles BEP event appears before event referencing the…
… file_set. Previously, when a `NestedSet<Artifact>` is referenced by multiple BuildEvents (perhaps transitively) there is a race in `BuildEventStreamer`, which receives all BuildEvents in an `@AllowConcurrentEvents` EventBus handler. If the BuildEvents are posted by different threads, the first will acquire the name for the `NamedSetOfFiles` and prepare the protobuf message from the NestedSet. In the meantime, the second thread will see the NestedSet's name was already acquired and may proceed to write its BuildEvent referencing the `named_set`. This leads to a violation of the expected ordering. Note that the ordering expectation here cannot be guaranteed by parent-child event relationships, as a given `NamedSetOfFiles` cannot 'know' all of the events that will reference it in advance. This is why `NamedSetOfFiles` events are children of `Progress` events. RELNOTES: Users consuming BEP may assume that a `named_set_of_files` event will appear before any event referencing that `named_set` by ID. This allows consumers to process the files for such events (eg. `TargetCompleted`) immediately. PiperOrigin-RevId: 361822335
- Loading branch information
1 parent
a1c8a44
commit fcf9dd5
Showing
3 changed files
with
174 additions
and
32 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