Skip to content

Synchronous batch asset import asserts in TaskGraph (RecursionGuard) and kills the editor #68

Description

@harness-lab

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.

Activity

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

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