Bug: synchronous batch asset import asserts in TaskGraph and kills the editor
Environment
- Engine: UE 5.8.0, CL
55116800, ++UE5+Release-5.8
- Plugin: UnrealMCPython 2.2.0
- OS: Windows 11
Repro
Drive a batch of asset imports synchronously in one util.execute_python call — e.g. building
an AutomatedAssetImportData set and importing several assets in a loop without returning to
the engine between them. The editor dies partway through.
Crash
Assertion failed: ++Queue(QueueIndex).RecursionGuard == 1
[File: .../Engine/Source/Runtime/Core/Private/Async/TaskGraph.cpp] [Line: 705]
That guard fires when the task graph is re-entered from inside a task it is already running.
The import work is being dispatched from within the bridge's own game-thread task, so it
nests.
Workaround
Import one asset at a time, letting each call fully return before issuing the next. I
imported 23 FBX meshes that way with no crash at all, having previously lost the editor to a
single batched call. The existing async/deferred import path (asset.import_gltf, which
returns pending: true and is polled with get_gltf_import_status) is well behaved and does
not have this problem — it is the synchronous batch route that breaks.
Suggested fix
Either route synchronous imports through the same deferred mechanism import_gltf already
uses, or document that batched synchronous imports are unsupported. As it stands the failure
mode is a hard process kill, and any unsaved work in the editor is lost with it.
Note on cost
Losing the editor mid-session loses unsaved assets. In my case a component added and compiled
moments earlier was gone, because compiling a Blueprint does not save it. Anything that can
take the process down deserves a guard rather than an assert.
Bug: synchronous batch asset import asserts in TaskGraph and kills the editor
Environment
55116800,++UE5+Release-5.8Repro
Drive a batch of asset imports synchronously in one
util.execute_pythoncall — e.g. buildingan
AutomatedAssetImportDataset and importing several assets in a loop without returning tothe engine between them. The editor dies partway through.
Crash
That guard fires when the task graph is re-entered from inside a task it is already running.
The import work is being dispatched from within the bridge's own game-thread task, so it
nests.
Workaround
Import one asset at a time, letting each call fully return before issuing the next. I
imported 23 FBX meshes that way with no crash at all, having previously lost the editor to a
single batched call. The existing async/deferred import path (
asset.import_gltf, whichreturns
pending: trueand is polled withget_gltf_import_status) is well behaved and doesnot have this problem — it is the synchronous batch route that breaks.
Suggested fix
Either route synchronous imports through the same deferred mechanism
import_gltfalreadyuses, or document that batched synchronous imports are unsupported. As it stands the failure
mode is a hard process kill, and any unsaved work in the editor is lost with it.
Note on cost
Losing the editor mid-session loses unsaved assets. In my case a component added and compiled
moments earlier was gone, because compiling a Blueprint does not save it. Anything that can
take the process down deserves a guard rather than an assert.