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

ResourceLoader: Fix deadlocks caused by the resource changed feature #96904

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

RandomShaper
Copy link
Member

  • One commit is another fixup to ResourceLoader: Add thread-aware resource changed mechanism #96593. (Despite the DEFVAL(1), the callable would fail due to not enough arguments unless I explicitly bind an argument!)
  • The other commit applies to the resource previewer. The main thread shouldn't be blocked when there are loads in progress, or otherwise the resource changed connections can't be flushed to it. You shouldn't block the main thread regardless this, even if we support busy polling the status of threaded resource loads, but that's a bonus. And the resource previewer was busy looping upon waiting for its thread to exit. It was letting the rendering server sync, but that's only part of the whole picture. In situations like that you'd rather run a full iteration, guaranteeing the engine "breathes" and can make progress in anything async.

Fixes #96790.

@RandomShaper RandomShaper added bug topic:core topic:editor regression cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Sep 12, 2024
@RandomShaper RandomShaper added this to the 4.4 milestone Sep 12, 2024
@RandomShaper RandomShaper requested a review from a team as a code owner September 12, 2024 10:33
@RandomShaper
Copy link
Member Author

Cherry-pick for 4.3 included in #96606.

@akien-mga akien-mga removed the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Sep 13, 2024
editor/editor_node.cpp Outdated Show resolved Hide resolved
@basicer
Copy link
Contributor

basicer commented Sep 13, 2024

Can confirm this patch fixes the issue I was seeing with deadlocks in EditorResourcePreviewGenerator::generate_from_path.

@akien-mga akien-mga merged commit 46d9db5 into godotengine:master Sep 16, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GradientTexture2D causing editor to hang when quitting
3 participants