Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@leitzler
Copy link
Member

@leitzler leitzler commented Mar 12, 2021

The previous file watchers was broken in several ways, where the two
major was:

  • A race condition in the non-darwin watcher (cmd/govim: race condition in file watcher #492)
  • Darwin recursively watched the entire module directory, disregarding
    sub-modules, testdata directories and directories prefixed by _ or .
    This caused the test suite to always fail on macOS.

This change:

  • Moves the non-recursive handling into os_other.go
  • Adds an OS independent function that filter events specifically
    disallowed by Go (i.e. "testdata", sub-modules and directories
    prefixed by _ or .
  • Adds more tests to raise file watching cover

Closes #492

@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch 2 times, most recently from aeee81b to 1cc6d9a Compare March 13, 2021 10:58
@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch 11 times, most recently from f22df9c to 227890f Compare April 2, 2021 22:02
@leitzler leitzler requested a review from myitcv April 5, 2021 09:26
Copy link
Member

@myitcv myitcv left a comment

Choose a reason for hiding this comment

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

I'll have a closer look later, but just a couple of initial questions.

@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch from 227890f to d5366e9 Compare April 10, 2021 22:14
@leitzler
Copy link
Member Author

Updated per your comments, PTAL when you have time.

@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch from d5366e9 to dca5475 Compare April 10, 2021 22:39
Copy link
Member

@myitcv myitcv left a comment

Choose a reason for hiding this comment

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

Some small nits, and one more fundamental questions. But overall, I'm very supportive and grateful for you tidying up this code. It's one of those areas with loads of edge cases. So better to get this in sooner rather than later, and then iterate of further fixes guided by tests.

@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch from 2cfd4eb to 483d1c7 Compare April 11, 2021 21:12
The previous file watchers was broken in several ways, where the two
major was:
* A race condition in the non-darwin watcher (#492)
* Darwin recursively watched the entire module directory, disregarding
  sub-modules, testdata directories and files/dirs prefixed by _ or .
  This caused the test suite to always fail on macOS.

This change:
* Moves the non-recursive handling into os_other.go
* Adds an OS independent function that filter events specifically
  disallowed by Go (i.e. "testdata", sub-modules and directories
  prefixed by _ or .
* Adds more tests to raise file watching cover

Closes #492
@leitzler leitzler force-pushed the cmd_govim_refactor_watcher branch from 483d1c7 to eca085c Compare April 11, 2021 21:29
@myitcv
Copy link
Member

myitcv commented Apr 12, 2021

Still LGTM 😄

@leitzler leitzler merged commit eb5bfc3 into main Apr 12, 2021
@leitzler leitzler deleted the cmd_govim_refactor_watcher branch April 12, 2021 18:31
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.

cmd/govim: race condition in file watcher

3 participants