Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2265] Expose fast-sync options on command line #1218

Conversation

AbdelStark
Copy link
Contributor

PR description

  • add --fast-sync-min-peers hidden cli option

  • add --fast-sync-max-wait-time hidden cli option

  • update FastSyncActions to handle no timeout behaviour (when timeout set to 0 or no timeout set then we just trigger asynchrounously the waitPeersTask)

  • update unit tests mock related to sync config builder

  • add fast sync options in everything_config.toml

  • re enable PantheonCommandTest.syncModeOptionMustBeUsed

Fixed Issue(s)

  • PAN-2265

- add `--fast-sync-min-peers` hidden cli option
- add `--fast-sync-max-wait-time` hidden cli option
- update `FastSyncActions` to handle no timeout behaviour (when timeout set to 0 or no timeout set then we just trigger asynchrounously the waitPeersTask)
- update unit tests mock related to sync config builder
- add fast sync options in `everything_config.toml`
- re enable `PantheonCommandTest.syncModeOptionMustBeUsed`
fix PAN-2265
fixes PAN-2265
gradlew spotlessApply
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

It looks good to me. Just a few changes to do. No big issues but that have to be fixed.

@NicolasMassart NicolasMassart added the api Related to public APIs label Apr 4, 2019
@NicolasMassart NicolasMassart requested a review from mbaxter April 4, 2019 15:28
- fix coding style convention
- add unit tests
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me if you change the two values in the tests

@@ -658,6 +678,19 @@ public void run() {
}
}

private void checkFastSyncOptions() throws ParameterException {
if (fastSyncMaxWaitTime < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Our parameter validation has been more just in time and directly in the configuration options rather than directly between the CLI and the config. It keeps the validations closer to where the parameters are actually stored. Validating in the CLI also provides a barrier to splitting the code apart.

Copy link
Contributor

Choose a reason for hiding this comment

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

A custom converter to restrict the integer to a positive non null one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of other integers have restriction. For example metrics interval in seconds are not checked too. So what is the best practice to perform those checks ?

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 suggest we keep like this for this PR. We need to define a way to do this kind of checks and implement it for all options in a separate ticket imo.

@AbdelStark AbdelStark merged commit f05d7a0 into PegaSysEng:master Apr 5, 2019
@AbdelStark AbdelStark deleted the feature/pan-2265-expose-fast-sync-opts-cli branch April 12, 2019 12:30
@mbaxter mbaxter mentioned this pull request Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api Related to public APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants