Skip to content

Scripts not loaded completely by ResourceLoader.load_threaded_request #108054

Open
@jamie-pate

Description

@jamie-pate

Tested versions

  • Reproducible (frequently) on:
    • Godot v4.5.beta1 - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Mobile) - integrated Intel(R) UHD Graphics 620 (Intel Corporation; 31.0.101.2115) - Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 threads) - 15.80 GiB memory
    • Godot v4.4.1.stable - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Mobile) - integrated Intel(R) UHD Graphics 620 (Intel Corporation; 31.0.101.2115) - Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 threads)
    • Godot v4.4.1.stable - macOS Sequoia (15.5.0) - Multi-window, 1 monitor - Metal (Mobile) - integrated Apple M1 (Apple7) - Apple M1 (8 threads)
    • Godot v4.4.1.stable - openSUSE Tumbleweed 20250624 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - integrated Intel(R) HD Graphics 5500 (BDW GT2) - Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 threads)
  • Reproducible (occasionally) on:
    • Godot v4.4.1.stable - Ubuntu 22.04.5 LTS 22.04 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU - 12th Gen Intel(R) Core(TM) i7-12700H (14 threads)

System information

Godot v4.4.1.stable - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Mobile) - integrated Intel(R) UHD Graphics 620 (Intel Corporation; 31.0.101.2115) - Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 threads)

Issue description

When loading scenes using ResourceLoader.load_threaded_request() they can sometimes be incomplete, and the nodes created using packed_scene.instantiate() will not have any script properties present.

Godot Engine v4.4.1.stable.official.49a5bc7b6 - https://godotengine.org

253:main_thread thread load start: 1 0.0 res://objective_list.tscn
254:main_thread thread load start: 1 0.0 res://login_screen/login_panel.tscn
254:main_thread thread load start: 1 0.0 res://objective_list_parent.tscn
372:main_thread thread load done: 3 1.0 res://objective_list.tscn
res://objective_list.gd: can_instantiate: false
landscape in node: false
_groups in node: false
_objectives in node: false
_selected_group in node: false
_selected_objective in node: false
_objective_detail in node: false
_signed_in in node: false
_progress in node: false
_current_location in node: false
WARNING: This scene failed to _init() ObjectiveList:<Control#35920020983> res://objective_list.tscn
DEBUG: Objective list init
res://objective_list.gd: can_instantiate: true
landscape in node: true
_groups in node: true
_objectives in node: true
_selected_group in node: true
_selected_objective in node: true
_objective_detail in node: true
_signed_in in node: true
_progress in node: true
_current_location in node: true
SUCCESS: loaded after 1 tries
396:main_thread thread load done: 3 1.0 res://objective_list_parent.tscn
DEBUG: Objective list init
DEBUG: Objective list ready() /root/Main/ObjectiveListParent/ObjectiveList
added res://objective_list_parent.tscn
pid 4133 succeded after 1 tries
iteration 1, 0 crashes, 1 concurrent, 1 retries

Steps to reproduce

extract MRP

Run reproduce.sh path/to/godot in bash (e.g. git bash for windows)

Reproduces almost every time on systems with 4 cores (8threads) or fewer... Very rare to reproduce on systems with more cores/threads

EDIT: set worker_pool/max_threads=1 to reproduce much more frequently
Also set your power profile to 'power saver'

[threading]

worker_pool/max_threads=1

Minimal reproduction project (MRP)

repro-thread-loading-mrp.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions