Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve Gradle retry logic #96554

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

Merged
merged 5 commits into from
Feb 18, 2022
Merged

Conversation

blasten
Copy link

@blasten blasten commented Jan 12, 2022

Related issue: #96550

Helps:
#96790
#96792

Improves the Gradle retry logic, so it retries up to 10 times after a first failure, and uses exponential backoff.
This is useful for network failures.

@blasten blasten requested review from GaryQian and zanderso January 12, 2022 21:56
@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 12, 2022
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

More retries w/ exponential backoff sgtm.

// The maximum number of Gradle retries.
// When a build fails due to a network failure, this is the maximum number
// of times that the build is re-attempted.
const int kMaxGradleRetries = 10;
Copy link
Member

Choose a reason for hiding this comment

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

This is effectively a timeout, which I think we should take the opportunity to remove. The way this could work is by letting the binary exponential backoff increase the backoff up to some maximum point (like 10s), and probably some time before then, use the tool's usual message about an operation taking longer than expected. The long operation message could be accompanied by the error text from gradle.

In practice if all these retries fail, CI will hit the job timeout, or the user will ctrl-c the process, which is how we handle other situations like this.

@christopherfujino
Copy link
Contributor

@blasten friendly ping, this is the fix to a p1 #96792

@blasten
Copy link
Author

blasten commented Jan 25, 2022

I lowered the priority of the issue. I will land this as soon as I can though.

@blasten blasten requested a review from zanderso February 5, 2022 03:17
@blasten
Copy link
Author

blasten commented Feb 5, 2022

PTAL @zanderso

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. lgtm.

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Linux web_long_running_tests_5_5 has failed. Please fix the issues identified (or deflake) before re-applying this label.
  • The status or check suite customer_testing-linux has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite customer_testing-linux has failed. Please fix the issues identified (or deflake) before re-applying this label.

@blasten
Copy link
Author

blasten commented Feb 18, 2022

@dnfield do you know if the flutter_svg test flaky or failing consistently? https://cirrus-ci.com/task/5417192308080640

@dnfield
Copy link
Contributor

dnfield commented Feb 18, 2022

Alternatively, try to rebase this patch to master to make sure the test harness picks up the right engine version.

@dnfield
Copy link
Contributor

dnfield commented Feb 18, 2022

It looks like there's a rfw failure in there too

@dnfield
Copy link
Contributor

dnfield commented Feb 18, 2022

Huh, my original comment never got posted - I was going to say that I think these are failing because of changes made to work with skParagraph, and maybe one image got missed - but I think what's really going on is the need to rebase this PR.

@dnfield
Copy link
Contributor

dnfield commented Feb 18, 2022

(You will need to specifically rebase - merge isn't enough based on how the logic in that script works)

@blasten blasten force-pushed the improve_gradle_retry branch from d5d2c88 to 5cf2d3d Compare February 18, 2022 19:06
@blasten
Copy link
Author

blasten commented Feb 18, 2022

That worked. Thanks

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 19, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants