This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Sync in-memory store w/ Consul at constant interval #278
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nathancoleman
force-pushed
the
config-sync
branch
2 times, most recently
from
July 11, 2022 22:50
534dad6
to
39e6a2b
Compare
nathancoleman
force-pushed
the
config-sync
branch
2 times, most recently
from
July 12, 2022 19:17
51b014e
to
94755a4
Compare
nathancoleman
force-pushed
the
config-sync
branch
from
July 12, 2022 20:28
94755a4
to
8a88806
Compare
This is necessary because the sync is guarded to only run if a listener on the gateway is marked as needing to sync. In this case where we sync at an interval, a listener will usually not be marked and so the sync would be skipped even if it's needed due to some drift in the consul config.
nathancoleman
force-pushed
the
config-sync
branch
from
July 19, 2022 14:12
eda173f
to
d0796b9
Compare
nathancoleman
force-pushed
the
config-sync
branch
from
July 19, 2022 15:02
5d7b269
to
c0135db
Compare
nathancoleman
force-pushed
the
config-sync
branch
from
July 20, 2022 21:51
d9bc66b
to
8ffe84a
Compare
nathancoleman
force-pushed
the
config-sync
branch
from
July 20, 2022 22:18
8ffe84a
to
f91e1b0
Compare
andrewstucki
approved these changes
Jul 22, 2022
) | ||
|
||
var ( | ||
ErrCannotBindListener = errors.New("cannot bind listener") | ||
consulSyncInterval = 60 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may want to consider moving this into a variable for command-line override eventually -- there should only be a few API calls per-gateway, but I would imagine that for some with large numbers of gateways deployed (not the normal case), this could cause problems down the line if it's too aggressive. That said, 60s seems like it's fairly safe in like 99.9% of use-cases (i.e. non-overloaded Consul server or low number of gateways).
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is longer-term followup based on #230 (comment)
Changes proposed in this PR:
Trigger a sync for our in-memory store at a constant interval in the background
How I've tested this PR:
Still working on how to test this in a programmatic fasion
How I expect reviewers to test this PR:
Checklist: