-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix(filewatcher): handle removed directories #8800 #9406
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 6 Skipped Deployments
|
@krlvi is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
When setting up manual recursive watching on folders (as is the case under Linux), the watching thread should not exit if a directory no longer exists. This is likely to occur within build output directories and it should not be the cause for interrupting the daemon.
2192491
to
3d21e39
Compare
Bumps buffers size for package change events from 1024 to 4096. With some build tools (e.g. cargo) the number of changes to the build direcotry can be quite large resulting in processing delay. It is also likely that during build operations the cpu resources are constrained further contributing to delays in event processing, thus increasing the buffer size seems appropriate
Hi @NicholasLYang - I noticed your comment here #8765 (comment) and also your name in git history and thought ping you on this PR for some feedback. BackgroundNormally I build our project on Mac where we experience no issues, however recently had the need to build it in a Linux VM and noticed the turbo filewatcher misbehaving. I did some manual testing with the projects mentioned but of course I wanted to reach out to see if there might be something I have not considered here. |
@@ -604,7 +604,7 @@ impl proto::turbod_server::Turbod for TurboGrpcServiceInner { | |||
.package_changes() | |||
.await; | |||
|
|||
let (tx, rx) = mpsc::channel(1024); | |||
let (tx, rx) = mpsc::channel(4096); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to surface the description for the commit-message as a motivation for this change, which should remove any element of surprise.
Bumps buffers size for package change events from 1024 to 4096.
With some build tools (e.g. cargo) the number of changes to the build
direcotry can be quite large resulting in processing delay.It is also likely that during build operations the cpu resources are
constrained further contributing to delays in event processing,
thus increasing the buffer size seems appropriate
Can confirm, this seems to have allowed me to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Looks good to me, I'd just add a log line
break 'outer; | ||
match err { | ||
WatchError::WalkDir(_) => { | ||
// Likely the path no longer exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a debug log here for this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look! Added a dbg log statement here f9e08fc
Adds debug logging when setting up file watching fails due to the directory no longer existing
Hi, I am one of those affected by the issue described here How do I test this patch on my monorepo? Sorry to ask, as I don't know how to apply these changes to my exact repo. |
Hey! If you have things set up you could build turborepo from source https://github.com/vercel/turborepo/blob/main/CONTRIBUTING.md using this branch and then in your on own project's build setup you can replace the references to Perhaps there is a way to create a binary with CI here, but as an external contributor I don't have permission to trigger CI |
Description
When setting up manual recursive watching on folders (as is the case under Linux), the watching thread should not exit if a directory no longer exists. This is likely to occur within build output directories and it should not be the cause for interrupting the daemon.
Likely fixes #8800 and #8491
Testing Instructions
Unit tests suite
cargo test -p turborepo-filewatch
Test building of GitBulter
(Within a Fedora Linux VM)
git clone https://github.com/gitbutlerapp/gitbutler cd gitbutler
turbo
with the turbo binary built from this branch, as an example: