# Deadlock in FlushAsyncLoading with assets which implement IsReadyForAsyncPostLoad 

**URL:** <https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [April 8, 2026, 8:57pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101 "2026-04-08T20:57:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 8, 2026, 8:57pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/1 "2026-04-08T20:57:00Z")

</div>

Hi,

We’re seeing a deadlock during loading related to IsReadyForAsyncPostLoad. Basically, what happens is that IsReadyForAsyncPostLoad needs game thread work to continue to complete but then FlushAsyncLoading() waits forever polling IsReadyForAsyncPostLoad before completing, which deadlocks.

This shouldn’t happen since in FAsyncPackage2::ExecuteDeferredPostLoadLinkerLoadPackageExports it checks this

```auto
	// We can't return timeout during a flush as we're expected to be able to finish
	const bool bIsReadyForAsyncPostLoadAllowed = ThreadState.SyncLoadContextStack.IsEmpty();

```

however, in this case bIsReadyForAsyncPostLoadAllowed is incorrectly true, since in FAsyncLoadingThread2::FlushLoading the FAsyncLoadingSyncLoadContext is only added if RequestIDs.Num() != 0 so the inner code is not aware a flush is happening.

This looks similar to what the test FLoadingTests\_IsReadyForAsyncPostLoad\_Flush is trying to validate, and in fact the issue can be reproduced by slightly modifying that test to call FlushAsyncLoading(); instead of FlushAsyncLoading(RequestId); Flushing all async loading instead of just the one package loaded by the test should work too, but instead it deadlocks.

Thanks,

Lucas

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 8, 2026, 8:57pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/2 "2026-04-08T20:57:04Z")

</div>

**Steps to Reproduce**  
Create an asset which overrides IsReadyForAsyncPostLoad() which does not return true until some GameThread work has been processed. Load it and call FlushAsyncLoading() with no request ids.

FLoadingTests\_IsReadyForAsyncPostLoad\_Flush can also reproduce if the FlushAsyncLoading() call is changed to not pass a specific request id

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Svegn2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/svegn2/32/924220_2.png) [@Svegn2](https://forums.unrealengine.com/u/Svegn2)\
**Post date:** [April 9, 2026, 7:31pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/3 "2026-04-09T19:31:22Z")

</div>

Hi.

IsReadyForAsyncPostLoad should not depend on work that happens on the game thread. We currently only have 1 use case in the engine that depends on Async work which will eventually complete in the case of a flush.

Can you provide more details on the object type that you have?

Martin

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Svegn2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/svegn2/32/924220_2.png) [@Svegn2](https://forums.unrealengine.com/u/Svegn2)\
**Post date:** [April 21, 2026, 12:57pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/4 "2026-04-21T12:57:01Z")

</div>

Can you try this CL? 52951549

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Svegn2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/svegn2/32/924220_2.png) [@Svegn2](https://forums.unrealengine.com/u/Svegn2)\
**Post date:** [April 21, 2026, 6:37pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/5 "2026-04-21T18:37:51Z")

</div>

Yes! That is the same change but on Main. The CL I shared is on Release5.8 as it was not available on Main at that moment.

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![dcou](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dcou/32/1135686_2.png) [@dcou](https://forums.unrealengine.com/u/dcou)\
**Post date:** [April 24, 2026, 6:48pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/6 "2026-04-24T18:48:31Z")

</div>

Hi Lucas,

GOnlyProcessRequiredPackagesWhenSyncLoading is some legacy from the old loader that caused issues with partial flushes. ZenLoader is expected to always handle partial flushes correctly so we’ll deprecate this now.

Best regards,

Danny

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 9, 2026, 7:56pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/7 "2026-04-09T19:56:58Z")

</div>

We are waiting for a conditionally launched async load of a soft reference to complete so that we don’t need to block in PostLoad for it, but that said it seems like the existing FLoadingTests\_IsReadyForAsyncPostLoad\_Flush tests the situation we are hitting. I would expect flushing one package vs flushing all packages to both work, but in that existing test flushing all packages (which includes the package loaded by the test) deadlocks, which seems like a bug.

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 21, 2026, 6:31pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/8 "2026-04-21T18:31:34Z")

</div>

Thanks, I’ll give it a shot! I didn’t find that exact CL number in Main but is it the same as 52954425?

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [April 21, 2026, 6:46pm UTC](https://forums.unrealengine.com/t/deadlock-in-flushasyncloading-with-assets-which-implement-isreadyforasyncpostload/2724101/9 "2026-04-21T18:46:57Z")

</div>

Great! I notice looking at the change that possibly there is bug if GOnlyProcessRequiredPackagesWhenSyncLoading==false. That’s not the default and we don’t set it, but without it SyncLoadContextStack is never added so to not deadlock the code would need to be

`const bool bIsFullFlush = RequestIDs.IsEmpty() || !GOnlyProcessRequiredPackagesWhenSyncLoading`but also, maybe that cvar is leftover debug code that doesn’t work already for other reasons so it’s fine. 🙂 Mentioning just incase

[Attachment Removed]
