Fix #112599: Blender freezes for half a minute when opening File Browser #116692
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116692
Loading…
Reference in New Issue
No description provided.
Delete Branch "mano-wii/blender:fix_112599"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The delay is caused by
Shortcut->Resolve(0, SLR_NO_UI | SLR_UPDATE)
to locate potentially moved or renamed paths.
The issue was resolved by adding the
SLR_NOSEARCH
flag..When investigating the issue, it was not difficult to find where the delay occurred.
The hardest part was understanding why Blender calls
Shortcut->Resolve
.The documentation of this method shows that it can behave differently depending on the flags that are used , and the one involved in the slowness is
SLR_UPDATE
.Resolving/refinding the directory of a 'Shell link' doesn't seem to be something within the scope of the File Browser. The only advantage of doing this is that
BLI_is_dir(entry->redirection_path)
may returntrue
after the directory is resolved and thus displayed in the File Browser if filter is enabled.But the adverse case seems to be much worse, as in addition to #112599, this action of resolving 'Shell link' could be the cause of the long wait to open Blender reported in #116675, #115935, #115806, #114247, #115008
So Blender better not try to fix these 'Shell link's.
Wow, great work tracking this down.
I would have never guessed that
Shortcut->Resolve
was optional there. And I would have assumed that problems with that would have come to light when we first added support for shortcuts, or when people started putting them in offline storage, etc. So wonderful that you looked here.When testing for this complaint, is the long time waiting for this from its initial check of "does this exist?" or from its subsequent search for it?
This function seems to use just two methods of finding an item if not found initially. The first being the distributed link tracking service, and the second being a search of the last known directory, subdirectories, etc. Both of these can be turned off with flags, so wondering if the problems go away if we turn off both methods by adding SLR_NOTRACK and SLR_NOSEARCH to the flag. If not, then best to not call it as you do in this PR.
But if that does improve things we might be able to get away with calling it with just
SLR_NO_UI | SLR_UPDATE | SLR_NOSEARCH
, so allowing distributed link tracking but not the recursive search. We could even add a custom timeout to this function, by setting the high word of the Flags argument to a timeout in milliseconds (only works when SLR_NO_UI is also set).Oh man I'm glad I found this, and I want to confirm this bug. I just recently started networking a shared file folder between my Mac and PC that I keep on both desktops, and whenever I tried to view the Desktop through Blender's File Browser Blender would freeze... well I though it was freezing and locking up.
Quick question. Is there a way that this could get pushed to 3.6?
Thanks for this.
SLR_NOSEARCH
solves the problem.Using this flag is indeed an advantage, but it may not be appropriate to call
Shortcut->Resolve
when the File Browser is simply navigating through a directory withShell Links
.In Windows, the Desktop directory is usually filled with shortcuts to applications. Thus, simply navigating the Desktop, Blender calls
Shortcut->Resolve
for each of these shortcuts.Ideally, in my opinion, calling
Shortcut->Resolve
should occur only when accessing theShell Link
.To determine if a
Shell Link
points to a directory (even with the target directory broken and withoutShortcut->Resolve
), we could do something like this:This way we could display the shortcut in the File Browser even though it is broken.
As long as the fix is compatible, and 3.6 is within the LTS period. This fix appears to qualify for backport:
https://projects.blender.org/milestones
Awesome! Yes, this change should go into main and be added to the backport lists.
Maybe? Now that we know that resolve is optional, then it should do almost nothing if the link is to a valid file, so should be super fast. I'm hoping so anyway.
That could work. We could add your earlier "fix if broken" argument, and skip that in the only place it is called now, when processing folder contents. Right now If that call is unsuccessful we make it look like a hidden file by giving it our FILE_ATTR_HIDDEN attribute. But since we are not fixing them we could instead add a new flag that indicates error or inaccessibility, FILE_ATTR_ERROR maybe. That could also be added on failure inside of
BLI_file_attributes
. I could color it red or add a stopsign icon or something to it. Then later we could choose to callBLI_file_alias_target
with that argument true for items that areFILE_ATTR_ALIAS
and FILE_ATTR_ERROR`. If we actually want to.This feature is mostly for shortcuts to blend files. Are we really going to get people complaining that the shortcut looks broken after they move the target file but Blender should automatically fix it for them?