Skip to content

refactor(fsnotifyext): remove unnecessary mutex usage from Deduper #2196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

wazazaby
Copy link

Hello,

This is a small refactor of the Deduper component, here's a list of the introduced changes :

  • Move the Deduper timers map to goroutine, to avoid mutex usage as it's read from / written to from a single goroutine.
  • Deduper.GetChan now returns a receive only channel, as only the internal fsnotify.Watcher instance should be allowed to send events to it.
  • Use fsnotify.Event.Has to check against Chmod operations (as per recommended by the fsnotify.Event.Op godoc).
  • In Executor.watchTasks - remove check against Chmod operations, it's already handled in the Deduper.GetChan goroutine.
  • Add a little bit of godoc on the Deduper.GetChan method to explain that.
  • Run a go mod tidy.

Following the contributing guidelines, I will squash the commits upon merging (if it ever happens ^^).

Thank you :)

@wazazaby wazazaby force-pushed the chore/improve-deduper branch from 8e8f35f to 478dd5e Compare April 22, 2025 09:53
@andreynering andreynering self-requested a review April 22, 2025 13:41
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.

1 participant