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

[FLINK-19773][runtime] Implement ExponentialDelayStrategy #14425

Closed
wants to merge 2 commits into from

Conversation

mareksabo
Copy link
Contributor

@mareksabo mareksabo commented Dec 18, 2020

What is the purpose of the change

This PR add new exponential restart strategy as described in FLINK-19773.

Brief change log

Added restart strategy for exponential backoff.

Verifying this change

  • This change added unit tests, see PR.
  • I manually verified that the restart strategy behaves as expected.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes, but only if the strategy is configured / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 18, 2020

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 3e9eb80 (Fri May 28 07:00:37 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • This pull request references an unassigned Jira ticket. According to the code contribution guide, tickets need to be assigned before starting with the implementation work.

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 18, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for creating this PR @mareksabo. It looks very good. I tried the changes out and they work well. The only thing which you need to do is to rerun mvn package -Dgenerate-config-docs -pl flink-docs,flink-core -DskipTests in order to rebuild the configuration documentation. Once this is done and AZP passes, I will merge the PR.

double backoffMultiplier,
Time resetBackoffThreshold,
double jitterFactor
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: using the style of this file, the closing parenthesis is usually put in the same line as the last parameter.

import static org.apache.flink.util.Preconditions.checkNotNull;

/**
* Restart strategy which tries to restart indefinitely number of times with a exponential backoff time in between.
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
* Restart strategy which tries to restart indefinitely number of times with a exponential backoff time in between.
* Restart strategy which tries to restart indefinitely number of times with an exponential backoff time in between.

restartStrategy.notifyFailure(failure);
assertCorrectRandomRange(
restartStrategy::getBackoffTime,
0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we set the max backoff time to something like 7 in order to test that we will respect it? At the moment it is set to 9 which means that we won't exceed the max backoff time after three failures if I am not mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, nice catch!

@mareksabo
Copy link
Contributor Author

mareksabo commented Jan 4, 2021

@flinkbot run azure

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks a lot for updating this PR @mareksabo. Merging this PR once AZP gives green light.

@mareksabo
Copy link
Contributor Author

Thank you. Although I generated the documentation there was still some information missing in the docs -- I hope I just fixed that.

@flinkbot run azure

@tillrohrmann
Copy link
Contributor

Really good work @mareksabo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants