Thread name conflict in MessageRouter

When creating a MessageEndpoint, SetRecipentThread() will strip the _Local suffix from the thread, but when sending messages, GetCurrentThreadIfKnown() is used, and that will currently always add the _Local suffix. GetCurrentThreadIfKnown() does take a bool bLocalQueue, but it’s never used. It’s also adding the Local Queue bit to any named thread, even those that don’t have a Local queue entry defined, like Stats.

Anyway, the net result is that one cannot pass messages on the GameThread, or RenderThread, as the filtering check in FMessageRouter::FilterSubscriptions() will fail for the thread.

In 4.7.6, _local was not stripped in MessageEndpoint, and _Local was also not added in GetCurrentThreadIfKnown().

If I were to guess, the boolean argument to GetCurrentThreadIfKnown() should determine if the local bit is set, but I’d prefer to get your opinion.

virtual ENamedThreads::Type GetCurrentThreadIfKnown(bool bLocalQueue) override
{
	ENamedThreads::Type Result = GetCurrentThread();
	if (Result >= 0 && Result < NumNamedThreads)
	{
		Result = ENamedThreads::Type(int32(Result) | int32(ENamedThreads::LocalQueue));
	}
	return Result;
}

Great catch, Judge! See if this commit helps: c74e74e

Thanks :slight_smile:

Thanks, this solves the problem!