-
Notifications
You must be signed in to change notification settings - Fork 285
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 fs.watch leak with a timestamp to prevent repetitive buildFromConfig #7238
Fix fs.watch leak with a timestamp to prevent repetitive buildFromConfig #7238
Conversation
Signed-off-by: Mike Seese <seesemichaelj@gmail.com>
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 PR! I have some requests, but that doesn't mean the PR being completely rejected — I'm happy to be convinced otherwise.
If I understand your analysis in #6315 correctly, the watcher instances are in fact sticking around after the abort controller has triggered?
We may need to manually call close()
on the watchers instead of relying on the abort signal?
Signed-off-by: Mike Seese <seesemichaelj@gmail.com>
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! This looks pretty close now.
The only actually relevant changes are to change the comment style in one spot (super trivial), plus clearing runBuildFromConfigTimer
in hide()
(actual logic bug).
Signed-off-by: Mike Seese <seesemichaelj@gmail.com>
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.
CI is being weird, but that's in yarn install
and this doesn't have anything to do with that.
This PR fixes #6315 by preventing
Tray::watchForChanges
from calling in a cyclic behavior in the first place. The prior logic was was designed to preventTray::buildFromConfig
from being called too frequently. The new logic callsTray::buildFromConfig
on each file change but the function will only continue if a second has passed since it was successfully called last time. With this,Tray::watchForChanges
is only called once.CC @mook-as