[Iris] Warns/Ensures when streaming out actors that are initially replicating

This doesn’t happen every single time, so im not entirely sure what the state is that’s required to produce it, other than we have lots of actors, several of them stream in that have replication enabled. As sometimes happens with streaming, the client might be streaming in a level or something, only to suddenly need to stop what they’re doing and stream in something else. This quick switch generates several ensures and one likely associated crash.

When i dug into the code I saw all those warnings are ensures as well, so i looked for those in our crash reports and found them,

ensureMsgf(false, TEXT("DetachInstanceProtocol for %s %s (%s) from client"), *PrintObjectFromIndex(InternalIndex),*Data.RefHandle.ToString(), Data.Protocol->DebugName->Name);The text file is the logs that set me on this path, and the image is from the callstack for the ensures.

I tried looking at updated lifetime management in iris, and a buncha stuff moved around to the factories since 5.5, so having a hard time tracking down any fixes in this area, or something I need to be aware of or patch to better handle some race issue between streaming and replication.

Hi,

This ensure is meant to indicate that a replicated object was destroyed on the client without the server telling the client to do so, but there can be false ensure triggered in some cases where it is expected for the client to locally destroy objects, such as during level streaming.

Because of this, the warning and ensure have been removed in 5.6 (CL 41683069 in UE5/Main).

Thanks,

Alex