Repository navigation
fix: Poll the override files when they cannot be watched - #495
Merged
Merged
Conversation
When watching was selected and the file watcher could not be created, for example because the limit on inotify instances was reached, the source logged the error and ran with no change detection, so a later edit never took effect. It now polls the files instead, at no less than the minimum poll interval, and the log says so.
Member
Author
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ea03508. Configure here.
kinyoklion
marked this pull request as ready for review
October 30, 2026 23:54
joker23
approved these changes
Nov 3, 2026
beekld
pushed a commit
that referenced
this pull request
Nov 6, 2026
🤖 I have created a release *beep* *boop* --- ## [7.22.0](v7.21.2...v7.22.0) (2026-11-06) ### Features * Broadcast Off to FDv2 status listeners when the data system stops ([#505](#505)) ([5c5b8ce](5c5b8ce)) * End an FDv1 fallback after a default TTL of one hour ([#499](#499)) ([1f03a5f](1f03a5f)) * Park FDv2 synchronizers instead of retiring them on unexpected failures ([#489](#489)) ([644253a](644253a)) ### Bug Fixes * Keep data from a store that is not initialized out of override evaluations and AllFlagsState, and report a store failure ([#491](#491)) ([1005a1a](1005a1a)) * Keep the override marking when a migration flag serves an unrecognized stage ([#492](#492)) ([9f9911f](9f9911f)) * Leave StateSince alone when a synchronizer starts ([#502](#502)) ([823b9aa](823b9aa)) * Make TestData ValueForAll return its value when targeting is off ([#507](#507)) ([7300bc1](7300bc1)) * Park a synchronizer that reports Off or closes its results ([#500](#500)) ([f6e9910](f6e9910)) * Poll the override files when they cannot be watched ([#495](#495)) ([170ad3b](170ad3b)) * Prevent a full status listener from hanging Close ([#498](#498)) ([9efd570](9efd570)) * Say that the data system retries after an unrecoverable HTTP error ([#501](#501)) ([d4066cc](d4066cc)) * Treat a repeated override file path in a different case as a repeat on Windows ([#494](#494)) ([eeb68d3](eeb68d3)) * Warn when offline mode skips the override source ([#493](#493)) ([69bbe61](69bbe61)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Cuts the Go server SDK release `7.22.0` and records its notes.** > > The root **`.release-please-manifest.json`** and **`internal/version.go`** now declare **`7.22.0`** (replacing `7.21.2`). **`CHANGELOG.md`** gains a new **`[7.22.0]`** section dated **2026-11-06** documenting shipped work: FDv2 data-system behavior (status **Off** broadcasts, synchronizer **parking** instead of retire, **FDv1 fallback TTL**, **StateSince** handling, parking on **Off**/closed results), plus multiple **bug fixes** around uninitialized store data in overrides/**AllFlagsState**, migration override marking, **TestData** when targeting is off, **override file** polling/deduping on Windows, offline-mode warnings, status listener **Close** hangs, and messaging for unrecoverable HTTP retries. > > No application code changes appear in this PR; it’s version bookkeeping and release notes only. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c763cc0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
With
ChangeDetection(Watching), a file override source whose file watcher cannot be created, for example because the limit on inotify instances is reached, logged "Unable to watch override files" and ran with no change detection at all. A later edit, creation, or deletion of an override file never took effect, which the OVERRIDE specification's Requirement 1.3.7 does not allow ("detecting changes by watching the files or by polling them, according to platform support").The source now falls back to polling in that case. It logs at Error level "Unable to watch override files; polling them instead every {interval}: {reason}" and polls at the configured interval raised to
MinimumPollInterval, because watching mode otherwise ignores the minimum. Polling mode and a watcher that starts normally are unchanged; the watcher's own retry for a directory it cannot watch yet is unchanged.The same gap was found by Bugbot on the Java implementation (launchdarkly/java-core#224) and is fixed there the same way.
Testing
TestFileSourceWatchingModeFallsBackToPollingWhenTheWatcherCannotBeCreatedreplaces the watch setup with one that fails, then checks that an edit is applied by polling and that the error is logged. With the poller creation removed, the test fails.go test -race ./...passes (31 packages) andmake lintreports no issues.Opened from termag
SDK-3419
Note
Overview
Watching mode for file override sources no longer leaves change detection disabled when the OS cannot create a file watcher (for example inotify limits). The source falls back to polling at the configured
PollInterval, clamped toMinimumPollInterval, and logs an error that includes the poll interval and failure reason.Production wiring is unchanged via an injectable
watchFileshook (defaultldfilewatch.WatchOptionalFiles) so tests can simulate watcher creation failure. Polling mode and successful watchers are unaffected.A new test verifies that edits are picked up via polling and that the fallback error message is logged.
Reviewed by Cursor Bugbot for commit ea03508. Bugbot is set up for automated code reviews on this repo. Configure here.