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

  1. Set Options.Process (the process id from StartProcessConfig) to a value <= 50000.
  2. Check launch args / StartProcessConfig for the offending id and correct it.
  3. Ensure process ids are allocated from a small contiguous range and never exceed 50000.
  4. 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

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


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/f527dea45db76ef9. Report an issue: GitHub.