{"record":{"id":"d89288363579d751","repo":"exo-explore/exo","slug":"max-buffer-size-must-be-either-an-integer-or-math","errorCode":null,"errorMessage":"max_buffer_size must be either an integer or math.inf","messagePattern":"max_buffer_size must be either an integer or math\\.inf","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/exo/utils/channels.py","lineNumber":435,"sourceCode":"            out.extend(self.collect())\n        return out\n\n    def __getstate__(self):\n        d = self.__dict__.copy()\n        d.pop(\"__orig_class__\", None)\n        return d\n\n\nclass channel[T]:  # noqa: N801\n    \"\"\"Create a pair of asynchronous channels for communicating within the same process\"\"\"\n\n    def __new__(\n        cls,\n        max_buffer_size: float = inf,\n        error_override_config: ErrorOverride | None = None,\n    ) -> tuple[Sender[T], Receiver[T]]:\n        if max_buffer_size != inf and not isinstance(max_buffer_size, int):\n            raise ValueError(\"max_buffer_size must be either an integer or math.inf\")\n        state = AnyioState[T](max_buffer_size)\n        return Sender(state, error_override_config), Receiver(\n            state, error_override_config\n        )\n\n\nclass mp_channel[T]:  # noqa: N801\n    \"\"\"Create a pair of synchronous channels for interprocess communication\"\"\"\n\n    # max buffer size uses math.inf to represent an unbounded queue, and 0 to represent a yet unimplemented \"unbuffered\" queue.\n    def __new__(cls, max_buffer_size: float = inf) -> tuple[MpSender[T], MpReceiver[T]]:\n        if (\n            max_buffer_size == 0\n            or max_buffer_size != inf\n            and not isinstance(max_buffer_size, int)\n        ):\n            raise ValueError(\n                \"max_buffer_size must be either an integer or math.inf. 0-sized buffers are not supported by multiprocessing\"","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/exo-explore/exo/blob/21a54c5ea0230a3bec1e1a786d200126c7e34ec6/src/exo/utils/channels.py#L417-L453","documentation":"Error \"max_buffer_size must be either an integer or math.inf\" thrown in exo-explore/exo.","triggerScenarios":"Thrown at src/exo/utils/channels.py:435 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"21a54c5ea0230a3bec1e1a786d200126c7e34ec6","analyzedAt":"2026-08-26T00:02:16.033Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}