# Race condition in GetFunctionSig\_Write() and other function signatures 

**URL:** <https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [September 8, 2026, 5:24pm UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527 "2026-09-08T17:24:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 8, 2026, 5:24pm UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527/1 "2026-09-08T17:24:36Z")

</div>

Hi, I believe there’s a race condition in GetFunctionSig\_Write() where multiple worker threads can progress past if (!Sig.IsValid()) and stomp on each other writing to the static FNiagaraVariable EmitVar (and potentially the static FNiagaraFunctionSignature Sig). We have seen this manifest when many Effect Instances using Data Channel write are spawned at the same time from a single system.

To mitigate, I moved the signature initialisation inside a static lambda.

```auto
		static const FNiagaraFunctionSignature OutSig = []
		{
			FNiagaraFunctionSignature Sig;
			static FNiagaraVariable EmitVar(FNiagaraTypeDefinition::GetBoolDef(), TEXT("Emit"));
			EmitVar.SetValue(FNiagaraBool(true));
			Sig.Name = TEXT("Write");
#if WITH_EDITORONLY_DATA
			NIAGARA_ADD_FUNCTION_SOURCE_INFO(Sig)
			Sig.Description = LOCTEXT("WriteFunctionDescription", "Writes data into the Data Channel at a specific index. Values in the DataChannel that are not written here are set to their defaults. Returns success if the index was valid and data was written into the Data Channel.");
#endif
			Sig.bMemberFunction = true;
			Sig.bRequiresExecPin = true;
			Sig.bWriteFunction = true;
			Sig.bSupportsGPU = false;//Cannot use direct index writes on GPU as we write into one shared buffer with all DIs using the same NDC data.
			Sig.AddInput(FNiagaraVariable(FNiagaraTypeDefinition(UNiagaraDataInterfaceDataChannelWrite::StaticClass()), TEXT("DataChannel interface")));
			Sig.AddInput(EmitVar, LOCTEXT("ExecuteWriteFlagTooltip", "If true then the write is executed, if false then this call is ignored and no write occurs."));
			Sig.AddInput(FNiagaraVariable(FNiagaraTypeDefinition::GetIntDef(), TEXT("Index")));
			Sig.AddOutput(FNiagaraVariable(FNiagaraTypeDefinition::GetBoolDef(), TEXT("Success")));
			Sig.RequiredInputs = IntCastChecked<int16>(Sig.Inputs.Num());//The user defines what we write in the graph.
			return Sig;
		}();
		return OutSig;

```

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 8, 2026, 5:24pm UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527/2 "2026-09-08T17:24:40Z")

</div>

**Steps to Reproduce** [Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Petrockets](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/petrockets/32/1142518_2.png) [@Petrockets](https://forums.unrealengine.com/u/Petrockets)\
**Post date:** [September 11, 2026, 12:06am UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527/3 "2026-09-11T00:06:21Z")

</div>

Hi Ben,

This does look like a potential race condition and your fix is likely something we’ll also implement. It looks like the same issue may impact other FNiagaraFunctionSignature lazy initializers in NiagaraDataInterfaceDataChannelWrite and NiagaraDataInterfaceDataChannelRead, have you fixed those too?

I’ve created the following issue for tracking which should be visible publicly soon [https://issues.unrealengine.com/issue/UE\-396123](https://issues.unrealengine.com/issue/UE%5C-396123)

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 16, 2026, 1:51pm UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527/4 "2026-09-16T13:51:07Z")

</div>

Hi, yes I did the same thing in all the places where a static FNiagaraFunctionSignature was lazily initialised. Thanks

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Petrockets](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/petrockets/32/1142518_2.png) [@Petrockets](https://forums.unrealengine.com/u/Petrockets)\
**Post date:** [September 17, 2026, 12:17am UTC](https://forums.unrealengine.com/t/race-condition-in-getfunctionsig-write-and-other-function-signatures/2841527/5 "2026-09-17T00:17:12Z")

</div>

Thanks, we’ve applied a similar fix in UE6 CL#58113338 ([afc0cf](https://github.com/EpicGames/UnrealEngine/commit/afc0cf126f7d96689d4012209096f2f0bea15974)) - Niagara: Fix race condition in Niagara Data Channel function signature lazy init

[Attachment Removed]
