Skip to content

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

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.


/// 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

Development

Successfully merging this pull request may close these issues.

3 participants