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

feat: gossip config reload information #1241

Merged
merged 9 commits into from
Jul 24, 2024
Merged

feat: gossip config reload information #1241

merged 9 commits into from
Jul 24, 2024

Conversation

kentquirk
Copy link
Contributor

@kentquirk kentquirk commented Jul 23, 2024

Which problem is this PR solving?

  • When a configuration is reloaded (and it has changed from the previous version) this publishes the news of the change by publishing the configuration hashes. Other peers will receive this message and immediately reload their configs.

Short description of the changes

  • Because config needs to be loaded to start the app, it can't depend on pubsub which hasn't been set up yet
  • So I created configwatcher, which lives outside config and can have both config and pubsub injected
  • It registers with config for callbacks, AND with pubsub for messages from peers
  • It publishes news of config changes with a timestamp
  • When it receives a message it checks the hashes; if they're different, it reloads
  • It publishes news of config changes only if it hasn't received a message in a little while (controlled by config)
  • Config tests had to be moved to config_test package in order to test reloading in this new world

@kentquirk kentquirk self-assigned this Jul 23, 2024
@kentquirk kentquirk force-pushed the kent.pubsub_config branch 2 times, most recently from 689a23f to 4f562ea Compare July 23, 2024 19:53
@kentquirk kentquirk force-pushed the kent.pubsub_config branch from 37d390a to 036309b Compare July 24, 2024 00:35
@kentquirk kentquirk marked this pull request as ready for review July 24, 2024 01:07
@kentquirk kentquirk requested a review from a team as a code owner July 24, 2024 01:07
internal/configwatcher/watcher.go Show resolved Hide resolved
internal/configwatcher/watcher.go Outdated Show resolved Hide resolved
internal/configwatcher/watcher.go Outdated Show resolved Hide resolved
internal/configwatcher/watcher.go Outdated Show resolved Hide resolved
@kentquirk kentquirk merged commit 829d38a into main Jul 24, 2024
5 checks passed
@kentquirk kentquirk deleted the kent.pubsub_config branch July 24, 2024 16:16
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.

2 participants