-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Discovery poll: wait PollInterval between fetches #41768
Merged
marcoandredinis
merged 2 commits into
master
from
marco/discovery_timer-insteadof-ticker
May 21, 2024
Merged
Discovery poll: wait PollInterval between fetches #41768
marcoandredinis
merged 2 commits into
master
from
marco/discovery_timer-insteadof-ticker
May 21, 2024
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
marcoandredinis
added
backport/branch/v14
no-changelog
Indicates that a PR does not require a changelog entry
backport/branch/v15
labels
May 20, 2024
tigrato
reviewed
May 20, 2024
case <-w.triggerFetchC: | ||
// stop and drain timer |
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.
move this near the reset
probakowski
approved these changes
May 20, 2024
Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches. Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hamering the external API by immediatly calling a new fetchAndSubmit right after ending the current one. This changes ensures we wait at least the specificied interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediatly).
marcoandredinis
force-pushed
the
marco/discovery_timer-insteadof-ticker
branch
from
May 21, 2024 07:08
e15be13
to
d517d8f
Compare
tigrato
approved these changes
May 21, 2024
@marcoandredinis See the table below for backport results.
|
marcoandredinis
added a commit
that referenced
this pull request
May 21, 2024
* Discovery poll: wait PollInterval between fetches Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches. Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hamering the external API by immediatly calling a new fetchAndSubmit right after ending the current one. This changes ensures we wait at least the specificied interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediatly). * move stop and drain closer to reset
This was referenced May 21, 2024
marcoandredinis
added a commit
that referenced
this pull request
May 21, 2024
* Discovery poll: wait PollInterval between fetches Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches. Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hamering the external API by immediatly calling a new fetchAndSubmit right after ending the current one. This changes ensures we wait at least the specificied interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediatly). * move stop and drain closer to reset
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 21, 2024
) * Document DiscoveryService poll interval knob * link to const instead of hard coding the default in godoc * Discovery poll: wait PollInterval between fetches (#41768) * Discovery poll: wait PollInterval between fetches Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches. Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hamering the external API by immediatly calling a new fetchAndSubmit right after ending the current one. This changes ensures we wait at least the specificied interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediatly). * move stop and drain closer to reset
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 21, 2024
) * Document DiscoveryService poll interval knob * link to const instead of hard coding the default in godoc * Discovery poll: wait PollInterval between fetches (#41768) * Discovery poll: wait PollInterval between fetches Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches. Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hamering the external API by immediatly calling a new fetchAndSubmit right after ending the current one. This changes ensures we wait at least the specificied interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediatly). * move stop and drain closer to reset
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport/branch/v14
backport/branch/v15
discovery
no-changelog
Indicates that a PR does not require a changelog entry
size/sm
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.
Instead of using a time.Ticker which would fire at specific intervals, we are now using a time.Timer which will wait PollInterval duration between API fetches.
Previously, with a low PollInterval or with a slow fetchAndSubmit, we could be hammering the external API by immediately calling a new fetchAndSubmit right after ending the current one.
This changes ensures we wait at least the specified interval before starting a new iteration (unless a DiscoveryConfig is changed, in that case the polling starts immediately).
#41761 (comment)