egametang/ET · critical · Exception
Process is too large: {Options.Instance.Process}
Error message
Process is too large: {Options.Instance.Process} What it means
GetProcessReplicaIndex (line 109) throws when Options.Instance.Process > 50000. ID generation packs Process + ReplicaIndex into a 16-bit ushort; the guard leaves headroom so Process + ReplicaIndex stays within ushort range. A Process value above 50000 would overflow when combined with ReplicaIndex.
Source
Thrown at Packages/cn.etetet.core/Scripts/Core/Share/World/IdGenerater/IdGenerater.cs:109
++this.second; // 借用下一秒的id
this.value = 0;
}
}
s = this.second;
v = this.value;
}
IdStruct idStruct = new(s, this.GetProcessReplicaIndex(), v);
return idStruct.ToLong();
}
public ushort GetProcessReplicaIndex()
{
// 因为改成了服务发现,支持一个进程多个副本,比如gate只需要配一个进程,可以支持多个,同一个Replica是同一个进程Id
// 需要预留出来Replica数量的进程Id
if (Options.Instance.Process > 50000)
{
throw new Exception($"Process is too large: {Options.Instance.Process}");
}
return (ushort)(Options.Instance.Process + Options.Instance.ReplicaIndex);
}
}
}
View on GitHub (pinned to 5cab01f7a8)
Solutions
- Set Options.Process (the process id from StartProcessConfig) to a value <= 50000.
- Check launch args / StartProcessConfig for the offending id and correct it.
- Ensure process ids are allocated from a small contiguous range and never exceed 50000.
- If you genuinely need more processes, revisit the ID layout (the ushort process field is a hard ceiling).
Defensive patterns
Strategy: validation
Validate before calling
if (Options.Instance.Process > 50000 || Options.Instance.Process < 0)
throw new InvalidOperationException($"Process id must be <= 50000, got {Options.Instance.Process}"); Prevention
- Keep process ids in a small range (<= 50000) to leave replica headroom.
- Validate Options.Process at startup before any GenerateId call.
- Avoid auto-incrementing process ids past the ceiling.
When it happens
Trigger: Starting the process with --Process (or the configured process id) greater than 50000, or a misconfigured StartProcessConfig id that exceeds the limit.
Common situations: Copy-paste error in process config with a too-large process id, auto-generation of process ids overflowing, env/launch args with a stray large number, misunderstanding that Process must be <= 50000 to reserve replica headroom.
Related errors
- zone: {zone} not found mongo connect string
- zone: {zone} not found mongo db name
- config factory target is null: {factory.GetType().FullName}
- create config factory failed: {factoryType.FullName}
- config factory not found: {configType.FullName}
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/f527dea45db76ef9.
Report an issue: GitHub.