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

chore: decrease exponential timeout of mirroring #4196

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

fraidev
Copy link
Contributor

@fraidev fraidev commented Sep 26, 2024

That should improve to not sleeping a lot at first seconds trying to connect.
Also helping our mirroring tests be more reliable.

@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch 2 times, most recently from 6deac59 to 46421a8 Compare September 26, 2024 22:33
@fraidev fraidev changed the title chore: increase sleep of mirroring tests chore: decrease backoff timeout of mirroring Sep 26, 2024
@fraidev fraidev changed the title chore: decrease backoff timeout of mirroring chore: decrease exponential timeout of mirroring Sep 26, 2024
@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch from 46421a8 to 1528f9b Compare September 26, 2024 22:51
@fraidev fraidev marked this pull request as ready for review September 26, 2024 22:58
@fraidev fraidev requested a review from digikata September 26, 2024 22:58
@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch 5 times, most recently from d342cf2 to ddffa26 Compare September 27, 2024 14:24
@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch from ddffa26 to d344743 Compare September 27, 2024 14:27
Copy link
Contributor

@digikata digikata left a comment

Choose a reason for hiding this comment

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

LGTM, but should we leave the max exp backoff, it seems like especially with an IoT network there could be fairly slow responses or dropped packets?

@sehz
Copy link
Contributor

sehz commented Sep 27, 2024

please add description on what this PR solves

@fraidev
Copy link
Contributor Author

fraidev commented Sep 27, 2024

LGTM, but should we leave the max exp backoff, it seems like especially with an IoT network there could be fairly slow responses or dropped packets?

Actually, my changes on min does even change the behavior, I found out that ExponentialBackoff does not support less than one second, because its build uses the as_secs_f64 method that will convert any ms to 1sec.

I propose then change the factor, we were using the default (2), easily to be stressed with only 30 secs. Only needing 6 hits to be totally stressed.

Proof: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=edf45c9360ced6084d922b057c6fb7c8

I changed the factor to 1.1 that will need 37 hits to be totally stressed!

Proof: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=46fb2a852aaf4b08b39abb4a7db79258

That should improve to not sleeping a lot at first seconds trying to connect. Also make our tests more realiable.

@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch from 6d6089e to 1916abb Compare September 27, 2024 21:10
@fraidev fraidev added this pull request to the merge queue Sep 28, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 28, 2024
* chore: decrease exponential timeout of mirroring

* chore: change default factor of mirroring backoff
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 28, 2024
@fraidev fraidev force-pushed the mirroring_tests_fix_sleep branch from c2cd74c to 1211362 Compare September 28, 2024 01:25
@fraidev fraidev enabled auto-merge September 28, 2024 02:28
@fraidev fraidev added this pull request to the merge queue Sep 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 28, 2024
@fraidev fraidev added this pull request to the merge queue Sep 28, 2024
Merged via the queue into infinyon:master with commit 062cbf8 Sep 28, 2024
119 checks passed
@fraidev fraidev deleted the mirroring_tests_fix_sleep branch September 28, 2024 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants