Skip to content

fix(compute): ignore attribute-only (Chmod) events in serve --watch#1808

Open
case wants to merge 2 commits into
fastly:mainfrom
case:watch-bug-fix
Open

fix(compute): ignore attribute-only (Chmod) events in serve --watch#1808
case wants to merge 2 commits into
fastly:mainfrom
case:watch-bug-fix

Conversation

@case
Copy link
Copy Markdown

@case case commented Jun 1, 2026

Change summary

This fixes #1332. The problem is described in the fsnotify readme - "As a rule, it's typically best to ignore Chmod events."

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

The infinite rebuild loop / flapping in #1332 is fixed.

Are there any considerations that need to be addressed for release?

None.

@case case requested a review from a team as a code owner June 1, 2026 20:14
@case case requested a review from anthony-gomez-fastly June 1, 2026 20:14
Copy link
Copy Markdown
Contributor

@jedisct1 jedisct1 left a comment

Choose a reason for hiding this comment

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

LGTM!

// (Create/Write/Remove/Rename) and not an attribute-only Chmod. fsnotify
// recommends ignoring Chmod; see its "Why do I get many Chmod events?" FAQ:
// https://github.com/fsnotify/fsnotify#why-do-i-get-many-chmod-events
func isContentChange(op fsnotify.Op) bool {
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.

isContentChange may be a bit confusing as it returns true for remove and rename operations, which don't really change the content. But naming things is hard :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @jedisct1! Would you prefer a different name? (e.g. is this blocking merging the PR?)

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.

infinite rebuild loop using compute serve --watch

2 participants