V0.9.10#16
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's New
Exponential backoff on poll failures
watch_externalno longer retries immediately on error. Failed polls now waitusing exponential backoff: the retry delay starts at the base
interval,doubles on each consecutive failure, and is capped at
interval × 32.A successful poll resets the wait back to
interval.Previously, a transient failure caused an immediate retry on the next tick with
only a warning log. Now the watcher backs off progressively, reducing noise and
load during extended outages.
New
WatchConfigtype andwatch_external_with_configentry pointWatchConfigexposesintervalandmax_backoffas explicit fields and isconstructed with a fluent builder:
watch_external_with_configaccepts aWatchConfiginstead of a bareDuration, giving full control over the retry ceiling:watch_externalremains unchanged as a convenience wrapper; it callswatch_external_with_configwithWatchConfig::new(interval)and a defaultmax_backoffofinterval × 32.Public re-exports
WatchConfigandwatch_external_with_configare now re-exported from thecrate root alongside the existing
ExternalEventandwatch_external.Correct feature flag name in documentation
The object-store feature is
"object-store", not"s3". The README andcode examples have been corrected.
Internal changes
watcher.rs: replaced thetokio::time::intervalticker with explicitsleepcalls so backoff waits can vary between iterations.store.rs: removed duplicate inline doc examples that duplicated theREADME; module-level and struct-level docs now point to the crate README for
backend-specific setup.
lib.rs: doc-link syntax updated ([crate::watcher::ExternalSource]→[watcher::ExternalSource]) to fix cross-reference resolution.tests/watcher.rs: addedFlakySource— a test double that fails aconfigurable number of times then succeeds — covering the backoff recovery
path. Three new async tests verify recovery after N errors, survival through
five consecutive failures, and
watch_external_with_configbehaviour.tests/watcher.rs: two unit tests coverWatchConfigconstruction:default
max_backoffequalsinterval × 32, andwith_max_backoffoverrides the default correctly.
Migration
watch_externalis source-compatible. No changes required for existing callers.To set a custom backoff ceiling, switch to
watch_external_with_config: