Skip to content

fix(fswatcher): Use a time.NewTicker channel for file re-syncs - #251

Merged
onelapahead merged 3 commits into
hyperledger-firefly:mainfrom
kaleido-io:fswathcer-fix-tick
Sep 9, 2026
Merged

onelapahead merged 3 commits into
hyperledger-firefly:mainfrom
kaleido-io:fswathcer-fix-tick

Conversation

@onelapahead

@onelapahead onelapahead commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

We observed in some environments, bc fswatcher can only watch a dir (and then filter by file), if there constantly changes to the dir (regardless of whether thats intended or a separate 🐛 ) - it prevents the re-sync from firing because we used a time.After in the for, meaning we reset it on every loop.

Using a time.NewTicker we get a channel that will add an event to the channel on the configured interval, so that no matter what the select will eventually hit the re-sync regardless of how many FS events we get, so we still re-sync eventually to make reconciliation reliable.

Signed-off-by: hfuss <hayden.fuss@kaleido.io>
Signed-off-by: hfuss <hayden.fuss@kaleido.io>
@onelapahead
onelapahead requested a review from a team as a code owner September 8, 2026 20:26

@peterbroadhurst peterbroadhurst left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very clear change 👍

Signed-off-by: hfuss <hayden.fuss@kaleido.io>
@onelapahead
onelapahead requested a review from awrichar September 8, 2026 23:15

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @onelapahead !

@onelapahead
onelapahead merged commit 25df1c3 into hyperledger-firefly:main Sep 9, 2026
3 checks passed
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.

3 participants