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
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related) #17701
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.
So just some minor stuff.
So the formatting needs to part of the commit it's from. Not a separate one at the end. Is that ok? |
your really testing my git skills!
|
Practice makes perfect. You could have used fixup's. So let's say the commit you want to change has hash XXXX and it's the 3rd commit in the past. Then once you have the edits handy just do something like this. When we rebase we do the position of the commit we are changing + 1 for the fixup.
|
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.
Nice, thanks for the fixes.
jenkins build this please |
1 similar comment
jenkins build this please |
Thanks! |
@AlwinEsch how do these fixes look to you? |
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.
Your changes are make sense and good to have.
Yah. This is my first addition into kodi core in over 10 years. Back then I added ability to insert a list item at a position. Up to then you could only append. Think it was in the addon window XML stuff and a user called donniedarko (or something close) committed it for me. Probably around 2008 |
First of many I hope 😉 We’ll wait a few days to see if there is any feedback from Milhouse and if it’s all good we can merge it. |
Feedback on personal testing - it's all good so far! This PR appears to have fixed issue #17049
|
That change to the cache couldn't actually cause any issues. |
Ok, then I think we consider merging this and closing #17579. Will do this in a couple days assuming further testing is ok. |
Ok, I will merge this later today as there has been no (negative) feedback). |
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Bug Fixes (2x addon related. 1x possibly serious filesystem cache related)
Fix 1
If you search via Add-ons > Search and there are multiple repos with a same add-on ID,
Kodi will show multiple entries of the same add-on.
Fix 2
Noticed that the database isn't closed before this return statement.
It is returned everywhere else. Potential db is kept open.
Fix 3
This is quite serious. The DirectoryCache becomes out of sync with the real filesystem.
Causing kodi to think directories still exist when they don't.
Easiest way to see the behavior is
When Kodi tries to install it again, it still thinks the addon path exists.
Error in log is
The below folder is removed when uninstalling
"C:\Kodi\addons\inputstream.adaptive\"
The cache layout looks like this (key is the parent directory)
We need to remove "C:\Kodi\addons" cache key.
The add-on is uninstalled here
https://github.com/xbmc/xbmc/blob/master/xbmc/addons/FilesystemInstaller.cpp#L70
That calls CFile::Rename
https://github.com/xbmc/xbmc/blob/master/xbmc/filesystem/File.cpp#L905
which calls g_directoryCache.ClearFile
https://github.com/xbmc/xbmc/blob/master/xbmc/filesystem/DirectoryCache.cpp#L115
this is where the problem is.
ClearFile assumes its getting a filepath but often it gets a directory path
It calls URIUtils::GetDirectory to get the parent directory of the path.
However, GetDirectory on a Directory returns itself.
The current flow is:
That is not in the cache so nothing is removed.
We need ClearFile to remove any trailing slash so it works correctly on directories and files.
That is what my last fix does.
Once that line is added, it goes:
Filepath are unaffected as the added RemoveSlashAtEnd doesn't affect them.
Who knows where else this has been causing issues.
Any renaming of directories could cause it.
Seems to be just in Matrix