{"record":{"id":"7e79852440d118cc","repo":"sgl-project/sglang","slug":"recycle-interval-must-be-positive-7e7985","errorCode":null,"errorMessage":"recycle_interval must be positive","messagePattern":"recycle_interval must be positive","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/cuda_vmm_transport_utils.py","lineNumber":186,"sourceCode":"\n\nclass CudaVmmMemoryPool:\n    \"\"\"Bounded CUDA VMM pool shared through FABRIC or a local POSIX FD.\"\"\"\n\n    def __init__(\n        self,\n        memory_size: int,\n        recycle_interval: float,\n        base_gpu_id: int,\n        consumer_count: int,\n        allow_posix_fallback: bool = False,\n    ) -> None:\n        if memory_size <= 0:\n            raise ValueError(\"memory_size must be positive\")\n        if consumer_count <= 0:\n            raise ValueError(\"consumer_count must be positive\")\n        if recycle_interval <= 0:\n            raise ValueError(\"recycle_interval must be positive\")\n\n        self.device_index = int(base_gpu_id)\n        self.consumer_count = int(consumer_count)\n        self._recycle_interval = float(recycle_interval)\n        self._lock = threading.Lock()\n        self._publisher_condition = threading.Condition(self._lock)\n        self._shutdown_lock = threading.Lock()\n        self._active_publishers = 0\n        self._closing = False\n        self._pool_full_warned = False\n        self._stop_recycler = threading.Event()\n        self._pool_error: BaseException | None = None\n        self._closed = False\n\n        self._allocation: VmmReservation | None = None\n        self.allocation_size = 0\n        self.shareable_handle = None\n        self.memory_pool = None","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/cuda_vmm_transport_utils.py#L168-L204","documentation":"Constructor guard: recycle_interval must be > 0 — the period for recycling published memory chunks. Zero or negative intervals would spin the recycler hot or break timing math.","triggerScenarios":"Passing recycle_interval=0 or a negative float from server args / config.","commonSituations":"Users setting an aggressive 'no delay' recycle interval of 0 thinking it disables recycling; missing default when constructing the pool manually.","solutions":["Use the documented default or a positive interval (e.g. 1.0 seconds)","Validate server args for this flag at startup","If recycling is unwanted, use the supported disable path rather than interval=0"],"exampleFix":"# before\npool = CudaVmmTransportPool(..., recycle_interval=0)\n# after\npool = CudaVmmTransportPool(..., recycle_interval=1.0)","handlingStrategy":"validation","validationCode":"if not (recycle_interval and recycle_interval > 0):\n    raise ConfigError(\"recycle_interval must be positive\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the documented default interval","Validate server args at parse time"],"tags":["cuda","vmm","validation","constructor"],"backgroundTag":"invalid-configuration-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}