-
-
Notifications
You must be signed in to change notification settings - Fork 609
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(#2906): resource leak on populate children #2907
fix(#2906): resource leak on populate children #2907
Conversation
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.
Love your work @ianhomer
FYI as a trusted member of the nvim-tree community you can push branches etc. to the main repo.
We're back to the pre-filter logic - not populating when nodes_by_path contains: https://github.com/nvim-tree/nvim-tree.lua/pull/2856/files#diff-1b05da4f503ff1df76cfeb7ef723f260d51acd287b0486f9de0ed61b2eeaa042L21
I'm buggered if I can replicate the telescope example, however this looks correct and might resolve #2902 |
It took me a while to isolate the steps to trip this. I do have a set of repositories (that I can't share) and it would happen every time I did the steps to reproduce. I ended up deleting stuff to find the minimal set to get the error, but may be I isolated steps for my env only. It feels like a race condition and perhaps it's also dependent on hardware performance. I just tested the steps to reproduce again and I do still get the error on the commit before this fix merged. I've also verified that the error doesn't happen for me on the latest release (after this fix merged), so looks good to me. |
Ah... you might be referring to this shameful hack: nvim-tree.lua/lua/nvim-tree/explorer/init.lua Line 447 in cd9c6db
Sounds like we've fixed the symptom at least. Let's monitor. |
I'm hoping we can get rid of that ineffective lock during https://github.com/orgs/nvim-tree/projects/1 |
FIx for #2906
It looks like there are some situations where the explorer tries to populate a node when it is already populated. This leads to a situation in the code where the filter reason is none, however the node has already been loaded. This in turn leads to an attempt to record the hidden stats for the reason. Since the reason however is none and the
hidden_stats
object has understandably not been initialised to capture stats for reason none, the following exception is thrownThe fix changes the logic so that no attempt to record hidden stats are made and the node is not reloaded. I'm assuming here that the node has been loaded OK if the path is in the
nodes_by_path
object. I welcome any feedback on whether that is a good assumption.