There’s a couple things about our case that I wanted to mention while avoiding confidential details:
- The use of TLazyObjectPtr is within a plugin and not our own code
- The actual call to GetAllReferencers for us comes from FBlueprintSupport::FlushReinstancingQueue()
The issue stems from the implementation of GetAllReferencersIncludingWeak using a ParallelFor while TLazyObjectPtr’s serialization (used to find referencers) doesn’t support it in all cases.
That said, I think the checkSlow is asymptomatic. The ObjectGuid has been valid in all the instances I’ve seen and the call stems from a ParallelFor on the GameThread so the GuidAnnotation global should only be getting read from (i.e. The GameThread isn’t doing work that is writing to the GuidAnnotation).
The potential fixes I’ve considered are:
- Force the ParallelFor GetAllReferencersIncludingWeak to always run SingleThreaded
- Check if the weakptr is equal in FArchiveUObject::SerializeLazyObjectPtr before assigning it
- Make the call threadsafe with RWLocks
- Move the “checkSlow” into the block for the if (!ObjectGuid.IsValid()) as writes to GuidAnnotation are what we really care about
I’m going with the last fix for now.
Is there a separate fix you would recommend?