Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send batch requests when scheduling new commit builds #1999

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

keyonghan
Copy link
Contributor

@keyonghan keyonghan commented Jul 22, 2022

With cocoon scheduling, a single schedule request of all builds will be created. This causes unpredicted builds schedule failure.

This PR use batch requests instead of a single request of ~300 builds: each batch is with default 5 builds.

Validation: a test version of cocoon wit this change has been running since yesterday.

Related: flutter/flutter#103443, flutter/flutter#92300

@@ -132,6 +134,9 @@ class FakeConfig implements Config {
@override
int get schedulingShardSize => 5;

@override
int get batchSize => batchSizeValue ?? 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this const in config.dart would prevent need to add this stub in the test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to have customized batchSize values to validate from test.

await _uploadToBigQuery(commit);
}

/// Schedule all builds in batch requests instead of a single request.
///
/// Each batch request contains `kBatchSize` builds to be scheduled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Each batch request contains `kBatchSize` builds to be scheduled.
/// Each batch request contains [Config.batchSize] builds to be scheduled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

for (int i = 0; i < toBeScheduled.length; i += config.batchSize) {
futures.add(luciBuildService.schedulePostsubmitBuilds(
commit: commit,
toBeScheduled: toBeScheduled.sublist(i, min(i + config.batchSize, toBeScheduled.length)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is sublist upper bound index non-inclusive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct.

Copy link
Contributor

@ricardoamador ricardoamador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keyonghan keyonghan added the autosubmit Merge PR when tree becomes green via auto submit App. label Jul 22, 2022
@auto-submit auto-submit bot merged commit cf050b6 into flutter:main Jul 22, 2022
@keyonghan keyonghan deleted the one_message_per_builder branch March 13, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App.
Projects
None yet
3 participants