feat(internal): add stat-based file change poller - #407
Merged
Merged
Conversation
kinyoklion
marked this pull request as draft
July 7, 2026 21:27
This was referenced Jul 7, 2026
feat(internal): add reload orchestration with debouncing and failure retry to file data loading
#406
Merged
kinyoklion
force-pushed
the
rlamb/sdk-2654/filedata-reloader
branch
from
September 9, 2026 23:24
c4f03ba to
7b5972a
Compare
kinyoklion
force-pushed
the
rlamb/sdk-2654/filedata-poller
branch
from
September 15, 2026 21:46
84242eb to
2365dd0
Compare
kinyoklion
marked this pull request as ready for review
September 17, 2026 16:57
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2365dd0. Configure here.
…ogress A file system that does not respond must not block shutdown. Close now signals the loop and returns, matching the Reloader, and the doc states that onChange can run once more shortly after Close. The doc uses ASCII, states that only modification time and size are compared, and drops the claim about temporarily unreadable files. Tests pin the Close contract, same-size and same-time changes, single firing per change, and changes to the first of several files.
kinyoklion
force-pushed
the
rlamb/sdk-2654/filedata-poller
branch
from
September 17, 2026 21:28
1f4977e to
96068d8
Compare
joker23
approved these changes
Sep 18, 2026
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.

Adds a
Pollertointernal/filedatathat detects file changes by examining modification time and size on a fixed interval. It exists for environments where file system notifications are unavailable or unreliable, such as network mounts, some containers, and Kubernetes ConfigMap symlink swaps. The file-based override source offers it as an alternative or a supplement to watching, and the file data sources can adopt it later.A file that appears or disappears counts as a change. A file that
os.Statcannot examine counts as absent. The poller compares only modification time and size, so a rewrite that keeps both values is not detected. Detection is otherwise generous. The callback feeds aReloader.Trigger, whose debouncing and skip-unchanged handling absorb spurious detections, so the poller itself stays small.Closesignals the poll loop and returns without waiting for an examination or callback in progress, matching theReloader. A file system that does not respond must not block shutdown, so the callback can run once more shortly afterClosereturns. Consumers tolerate that as they do a late reload.Internal only. Nothing in this PR consumes it.
SDK-2654
Note
Overview
Introduces a new
Pollerininternal/filedatathat watches a list of paths on a fixed interval and invokes anonChangecallback whenos.Statreports a different existence, modification time, or size. It is meant for setups where fsnotify-style watching is unreliable (e.g. network mounts, ConfigMap symlink swaps), with the intent to driveReloader.Triggerlater; nothing in this PR wires it up yet.NewPollersnapshots state before returning so the first tick does not fire spuriously;Closestops the loop without waiting on in-flight stats or callbacks (same shutdown posture asReloader), with tests covering multi-file watches, create/delete, and non-blocking close while a callback blocks.Reviewed by Cursor Bugbot for commit 96068d8. Bugbot is set up for automated code reviews on this repo. Configure here.