Deadlock while cooking groom bindings

Hi, we are experiencing random deadlocks while cooking groom bindings. We have integrated 5.8 mutable into 5.6 and are still experimenting those deadlocks which seem due to :

UE_DEPRECATED(5.4, “This class is deprecated, there is no replacement because this is not a safe async design.”)

UE_API FScopedSkeletalMeshRenderData(USkeletalMesh* Mesh);

https://github.com/EpicGames/UnrealEngine/blob/772ce4ed717be4bd427ca1b59a32b1e82bab2466/Engine/Source/Runtime/Engine/Classes/Engine/SkeletalMesh.h\#L417

Is there any plan/ETA to fix this ?

The deadlock happens here:

https://github.com/EpicGames/UnrealEngine/blob/772ce4ed717be4bd427ca1b59a32b1e82bab2466/Engine/Plugins/Runtime/HairStrands/Source/HairStrandsCore/Private/GroomBindingBuilder.cpp\#L2884

Cheers

[Attachment Removed]

Hey there,

Apologies for the delay, this isn’t an issue we’ve seen yet. I’ve logged an issue you can follow here. https://issues.unrealengine.com/issue/UE-386691

Is this happening during a specific type of asset cook like Mutable or just in general?

Dustin

[Attachment Removed]

Hey Dustin. We have not see the deadlock recently, but we have a bandaid in place and also we believe integrating epic CL 48420802 helped with the issue, if this can help you pinpointing the problem.

Below are the temptative fixes we put as a bandaid (see in between the TNM EDIT START/STOP markers):

In SkeletalMesh.cpp:

void USkeletalMesh::Build()

{

TRACE_CPUPROFILER_EVENT_SCOPE(USkeletalMesh::Build);

// Tell the compiler to finish compiling us if we have a pending

// compilation ongoing plus any dependency (i.e. UGroomBindings).

// TNM EDIT START : mmoulis Fixing groom binding deadlock at cook per Jon’s fix in workshop branch

if (IsCompiling())

{

FAssetCompilingManager::Get().FinishCompilationForObjects({this});

}

// TNM EDIT STOP

FSkinnedAssetAsyncBuildScope AsyncBuildScope(this);

FEvent* USkeletalMesh::LockPropertiesUntil()

{

TRACE_CPUPROFILER_EVENT_SCOPE(USkeletalMesh::Import);

check(IsInGameThread());

FEvent* Event = FPlatformProcess::GetSynchEventFromPool();

check(Event);

// Tell the compiler to finish compiling us if we have a pending

// compilation ongoing plus any dependency (i.e. UGroomBindings).

// TNM EDIT START

if (IsCompiling())

{

FAssetCompilingManager::Get().FinishCompilationForObjects({ this });

}

// TNM EDIT STOP

//Use the async task compile to lock the properties

FSkinnedAsyncTaskContext Context(Event);

BeginAsyncTaskInternal(Context);

[Attachment Removed]

Thanks, I’ve logged this as a comment on the fix.

[Attachment Removed]

The issue is currently still unresolved. I’ve pinged the team, but they will tackle it when they can.

Dustin

[Attachment Removed]

So, is there a fix incoming ? Or even better, is there a CL# for that fix ? I can confirm our bandaid does not fix the issue

[Attachment Removed]