Async level streaming update crashes with FindObjectFast

Hi,

In our project, we’ve enabled `wp.runtime.UpdateStreaming.EnableAsyncUpdate` to ensure world loading is smooth. However, some of us experienced crashes with this enabled. I also managed to reproduce it on my end.

The crash seems to be caused by the async level streaming update happening at the same time as the garbage collection, particularly when a level is unloaded. As far as I can tell, there might be a race condition, where the garbage collection flag is set during the small frame in `ULevelStreaming::GetLevelStreamingStatus` between the check for `IsGarbageCollecting` and the call to `StaticFindObjectFast`, causing the latter to crash.

Additionally, though this seems less relevant, `ULevelStreaming::GetLevelStreamingStatus` checks `IsGarbageCollecting`, while `StaticFindObjectFast` checks `IsGarbageCollectingAndLockingUObjectHashTables` instead. (As well as `IsSavingPackage`)

Is there any way we can prevent this crash, without turning off the variable?

For completion, I’ve attached a list of engine settings we use in our project. Hopefully this may help with reproducing the issue.

[Attachment Removed]

Steps to Reproduce
Problem seems to occur with particularly big and dense worlds. A coworker got it at least twice, I got it once in our project. I did not manage to reproduce it with a test project yet.

[Attachment Removed]

Hello!

That problem was resolved in CL49409329.

Regards,

Martin

[Attachment Removed]

Hello!

That fix was made past the deadline for 5.7.4 and is in the Main stream. It will be part of version 5.8.

It’s single line of code. It should be an easy integration.

Martin

[Attachment Removed]

Hi, thanks for the fast reply!

Is this in the vanilla version of 5.7? I didn’t see it last I checked. If not, when would this be merged into the engine?

[Attachment Removed]