{"record":{"id":"5e2718ad8fd0e77b","repo":"sgl-project/sglang","slug":"unsupported-disaggregationmode-self-disaggregati","errorCode":null,"errorMessage":"Unsupported DisaggregationMode: {self.disaggregation_mode}","messagePattern":"Unsupported DisaggregationMode: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/disaggregation/common/conn.py","lineNumber":291,"sourceCode":"            self.max_failures = max(\n                envs.SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE.get(), 1\n            )\n            # If a timeout happens on the decode side, it means decode instances\n            # fail to receive the KV Cache transfer done signal after bootstrapping.\n            # These timeout requests should be aborted to release the tree cache.\n            self.waiting_timeout = envs.SGLANG_DISAGGREGATION_WAITING_TIMEOUT.get()\n            # PD true-retraction rebootstrap: a shared executor + per-thread HTTP\n            # sessions used to drive the original prefill worker's ``/generate``\n            # endpoint so it recomputes a retracted request's prefix KV under the\n            # current weights. Created lazily on first use so deployments that\n            # never retract pay nothing.\n            self._prefill_recompute_executor: Optional[\n                concurrent.futures.ThreadPoolExecutor\n            ] = None\n            self._prefill_recompute_executor_lock = threading.Lock()\n            self._prefill_recompute_sessions = threading.local()\n        else:\n            raise ValueError(\n                f\"Unsupported DisaggregationMode: {self.disaggregation_mode}\"\n            )\n\n    def _should_skip_cp_replicated_state_transfer(self) -> bool:\n        \"\"\"Whether this prefill rank should omit CP-replicated state.\n\n        Prefill CP materializes global token order before writing state pools, so\n        every CP rank holds the same state. When all CP ranks transfer their KV\n        shards, only rank 0 needs to send that state. Cache layer split is the\n        exception because each CP rank owns different state layers.\n        \"\"\"\n        return (\n            self.attn_cp_size > 1\n            and self.attn_cp_rank != 0\n            and not get_parallel().enable_dsa_cache_layer_split\n        )\n\n    def requires_dcp_relayout(self, dst_dcp_size: int, dst_dcp_rank: int) -> bool:","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/disaggregation/common/conn.py#L273-L309","documentation":"The common (shared) PD connection object only supports PREFILL and DECODE disaggregation modes; its __init__ sets up prefill-side executors for the prefill branch and decode-side state otherwise, and raises ValueError for any other DisaggregationMode value.","triggerScenarios":"Constructing the common PD connection class with disaggregation_mode set to NONE (or None) — i.e. the connection object is instantiated although the server is not in PD mode.","commonSituations":"Code path that unconditionally builds the disaggregation connection even in normal (non-PD) serving; missing or mis-parsed --disaggregation-mode argument; test harness constructing the object with a default mode.","solutions":["Pass --disaggregation-mode prefill or decode explicitly on every PD node","Only instantiate the connection when the server is in PD mode; gate on disaggregation_mode != DisaggregationMode.NONE","Check argument parsing if the CLI value is silently dropped before reaching the connection"],"exampleFix":"# before\nconn = PDConnection(args...)  # args.disaggregation_mode == NONE\n# after\nconn = PDConnection(args...) if args.disaggregation_mode != DisaggregationMode.NONE else None","handlingStrategy":"validation","validationCode":"if disaggregation_mode not in (DisaggregationMode.PREFILL, DisaggregationMode.DECODE):\\n    raise SystemExit('PD connection requires --disaggregation-mode prefill|decode')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate connection construction on PD mode being enabled","Set --disaggregation-mode explicitly in all PD launch scripts","Fail fast on invalid mode in config parsing, not deep in __init__"],"tags":["disaggregation","config","init","pd"],"backgroundTag":"invalid-configuration-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}