Skip to content
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

IDE: deep_read_directory should own the lock #646

Open
giuliomoro opened this issue Nov 5, 2020 · 0 comments
Open

IDE: deep_read_directory should own the lock #646

giuliomoro opened this issue Nov 5, 2020 · 0 comments

Comments

@giuliomoro
Copy link
Contributor

FileManager.ts:deep_read_directory() doesn't hold the lock throughout its execution. This is probably because some of the functions it calls (e.g.: stat_file(), read_directory() require the lock, which would deadlock). However, the issue with this is that it sometimes try to stat_file() on a file that was in the original read_directory() result but has since been deleted. When listing projects this means that it may miss the .render.cpp~ temp file (no big deal), or possibly (unverified) render.cpp itself when the latter is replaced with a newer version. A re-entrant lock would be needed here (not sure it's possible to implement it in node), or at least a way of telling the functions it calls "trust me, I have the lock".

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

No branches or pull requests

1 participant