Blueprint references to level Actors are lost when streaming out and back in the level

Hello, Brian, thank you for helping us.

This type of issues hard to reproduce. I was unable to do it on my machine, it happens sporadically while our QA finishing the level, so for now there is no 100% repro. I am still looking for a repro now. And as soon as I find something I will post it here, but I can’t guarante a success. I will also analyze their reports and add some more info.

We are using 4.18 now. In our modifications we have very small amount of networking related changes. And we are not touching nothing related to replicators and channels (and as soon as I removing the patch from the version the crash goes away). Anyway, I think as it’s a good idea to provide as much information as I can, so I will show you the only suspicious change (but it doesn’t look related) we’ve made in the engine:

void UNetDriver::InternalProcessRemoteFunction ( line 1295 )
	(
	...
	// Get the actor channel.
	UActorChannel* Ch = Connection->ActorChannels.FindRef(Actor);
	if( !Ch )
	{
		if( IsServer )
		{
			//SBZ
			if ( Actor->IsPendingKillPending() || Actor->bTearOff ) (line 1359)
			{
				// Don't try opening a channel for me, I am in the process of being destroyed. Ignore my RPCs.
				return;
			}
			// SBZ

we don’t create a new channel for tearred of actors, if someone tries to send rpc call, that’s it. Don’t think this changes lead to the crash.

Can we add some workaround for the Replicator issue now? some critical section or if branches? the only things removes actors from ActorChannels are:

void UActorChannel::Close()
void UActorChannel::SetClosingFlag()
void UNetDriver::NotifyActorLevelUnloaded( AActor* TheActor )

I think I should log this too, and hope engine will be able to flush this data before the crash.