-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve performance of BES handling for Aspect CLI & Workflows p…
…lugin (#7585) Resolves performance issues with BES event processing in the Aspect CLI and in the Workflows plugin. The current implementation was the receiving a single bes event, forwarding it to Workflows plugin, waiting for response from plugin and finally sending ack back to the Bazel server for that event before starting the recv for the next bes event. This was created a bottleneck since events could not be received and processed and ack'd in parallel. The fix here is to leverage multiple go routines in the BES backend: - 1 to recv the grpc BES stream events from the Bazel server - 10 to forward to Workflows plugin with BEPEventCallback API calls - 1 to ack the grpc BES events so the Bazel server keeps sending as we are receiving and processing Plugins need to be opted in the new behavior via `.aspect/cli/config.yaml` setting. Plugins that opt-in will need to handle multi-threaded calls on that method and potentially out of order events. For this reason, this performance bump is being landed as an opt-in so customers with custom plugins can update their custom plugin code accordingly before turning it on. Airtable will be the first to opt-in after this lands since they are suffering the most from the bug (60+ seconds of BES processing after the bazel build completes on some of their builds). --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes Workflows now supports faster build event transmission to Aspect CLI plugins by sending up to 10 build events in parallel via 10 concurrent BEPEventCallback calls. Plugins can opt-in to faster build event transmission by setting `multi_threaded_build_events: true` in their configuration in the `.aspect/cli/config.yaml` configuration file. Plugins that opt-in must handle multi-threaded BEPEventCallback. If plugins require build events to be processed in order they should buffering out-of-order build events and processing the build events in order of sequence number. The sequence number of a build event can be obtained via a new 2nd parameter of the BEPEventCallback function: `BEPEventCallback(event *buildeventstream.BuildEvent, sequenceNumber int64)` ### Test plan - Covered by existing test cases GitOrigin-RevId: e4fa5c4d4d1866b282b56fdbc23d8ad5d171c253
- Loading branch information
1 parent
dbdc5bb
commit 45d04ed
Showing
13 changed files
with
249 additions
and
146 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
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
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.