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

Allow changing configuration at runtime via Foca::set_config #7

Merged
merged 4 commits into from
May 29, 2022

Conversation

caio
Copy link
Owner

@caio caio commented May 27, 2022

These patches expose a new method Foca::set_config to allow tuning parameters at runtime, preserving the known cluster state and the current identity.

Additionally, if the std feature is set, two helpers are exposed to help create a config: Config::new_wan and Config::new_lan.

I didn't feel comfortable bringing in the whole dynamic configuration logic into Foca because:

  • relevant parameters don't actually change much during normal operations
  • the use case where cluster size changes drastically during normal ops is not super common and can be covered by Foca::num_members + Foca::set_config
  • would need nightly's core_instrinsics (or jump into libm / another dep) for math on no_std

Might revisit this decision in the future if I ever buy into lifeguard/awareness

Resolves #6

caio added 4 commits May 27, 2022 10:56
This patch simply moves `max_transmissions` outside of `Broadcast`, so
that the number of transmissions can be defined at runtime
This patch introduces `Config::new_lan` and `Config::new_wan` methods
to derive configurations that should work well in their parciular
network environment.

Settings are a direct port from hashicorp's memberlist, mistakes are
mine.
This patch introduces `Foca::set_config` which allows changing (some)
configuration parameters while Foca is running and swimming.
@caio caio mentioned this pull request May 28, 2022
@caio caio merged commit e55ff3f into main May 29, 2022
@caio caio deleted the set-config branch May 29, 2022 06:59
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.

Adaptive max_transmissions
1 participant