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

support exponential backoff when tailing files #17

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

rfratto
Copy link
Member

@rfratto rfratto commented Mar 9, 2023

This commit extends the API of watch.NewPollingFileWatcher to accept options for how frequently files should be polled. By default, if the zero value is given, the previous value of polling every 250ms will be used.

The customizable polling frequency supports exponential backoff; the polling frequency will be doubled every time polling results in no changes up to hitting MaxPollFrequency. The polling frequency is reset to MinPollFrequency when a file change is detected.

This commit extends the API of watch.NewPollingFileWatcher to accept
options for how frequently files should be polled. By default, if the
zero value is given, the previous value of polling every 250ms will be
used.

The customizable polling frequency supports exponential backoff; the
polling frequency will be doubled every time polling results in no
changes up to hitting MaxPollFrequency. The polling frequency is reset
to MinPollFrequency when a file change is detected.
@rfratto rfratto requested a review from cstyan March 9, 2023 16:24
Copy link

@cstyan cstyan left a comment

Choose a reason for hiding this comment

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

overall lgtm

tail.go Outdated Show resolved Hide resolved
@rfratto rfratto merged commit 205c771 into grafana:master Mar 21, 2023
@rfratto rfratto deleted the support-exponential-polling-backoff branch March 21, 2023 21:54
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.

None yet

2 participants