Hey,
We regularly see the ensure(false) in FReplicationReader::ResolveAndDispatchUnresolvedReferencesForObjects line 2040, with the error “Trying to resolve references for non-existing object ( InternalIndex: %u )”.
The context is we have player pawns which can be conditionally replicated to a client, which are referenced by an always relevant player state for each player (via an AbilitySystemComponent on the player state), and so when a player pawn stops being replicated to a client Iris keeps track of the unresolved references to the pawns in FReplicationReade::UnresolvedHandleToDependents.
Seems that what might be happening is that this map can end up with duplicate owner->networkhandle entries over time, and when the owner is destroyed (eg, in this case when a player leaves a session and their replicated player states are destroyed for other players), the map can end up with stale entries for the duplicates.
There’s a comment on line 1864 to the effect that it’s intentional that the map can contain duplicates but that TMultiMap::Remove() should be used when clearing entries for the map, but I see that RemoveSingle() is used in a couple of places when removing tracked handles.
- I see one instance of Remove() being used on that map in FReplicationReader::UpdateObjectReferenceTracking_Fast, and I haven’t seen the ensure fire with fast object tracking enabled. The CVar mentions it’s still in testing though so would you recommend against using it?
- Alternatively should Remove() be used other places, or do you have any other suggestions around this? (edit: I notice that the comment above about Remove() relates to the fast object tracking code path, so is it a bug with the normal route that duplicate entries can exist in the first place?)
Thanks
Alistair
[Attachment Removed]