{"id":"21b9499a7bb98dab","repo":"redis/redis-py","slug":"client-pause-timeout-must-be-an-integer","errorCode":null,"errorMessage":"CLIENT PAUSE timeout must be an integer","messagePattern":"CLIENT PAUSE timeout must be an integer","errorType":"validation","errorClass":"DataError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":1240,"sourceCode":"        For more information, see https://redis.io/commands/client-pause\n\n        Args:\n            timeout: milliseconds to pause clients\n            all: If true (default) all client commands are blocked.\n                 otherwise, clients are only blocked if they attempt to execute\n                 a write command.\n\n        For the WRITE mode, some commands have special behavior:\n\n        * EVAL/EVALSHA: Will block client for all scripts.\n        * PUBLISH: Will block client.\n        * PFCOUNT: Will block client.\n        * WAIT: Acknowledgments will be delayed, so this command will\n            appear blocked.\n        \"\"\"\n        args = [\"CLIENT PAUSE\", str(timeout)]\n        if not isinstance(timeout, int):\n            raise DataError(\"CLIENT PAUSE timeout must be an integer\")\n        if not all:\n            args.append(\"WRITE\")\n        return self.execute_command(*args, **kwargs)\n\n    @overload\n    def client_unpause(self: SyncClientProtocol, **kwargs) -> bytes | str: ...\n\n    @overload\n    def client_unpause(\n        self: AsyncClientProtocol, **kwargs\n    ) -> Awaitable[bytes | str]: ...\n\n    def client_unpause(self, **kwargs) -> (bytes | str) | Awaitable[bytes | str]:\n        \"\"\"\n        Unpause all redis clients\n\n        For more information, see https://redis.io/commands/client-unpause\n        \"\"\"","sourceCodeStart":1222,"sourceCodeEnd":1258,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/commands/core.py#L1222-L1258","documentation":"Raised by client_pause when timeout is not an int. The value is str()'d into the command args, so a float or string would produce a malformed value. Note: the isinstance check happens AFTER str(timeout) is already concatenated, so the args list is built from whatever type was passed before the guard fires.","triggerScenarios":"Calling r.client_pause(timeout=5.0) with a float. Passing timeout='1000' as a string. Passing a timedelta or Decimal object.","commonSituations":"Timeout read from config as a float (e.g., seconds parsed from YAML). Division/multiplication producing a float where an int was expected. Passing milliseconds computed from a float expression.","solutions":["Pass an int: r.client_pause(timeout=1000).","Coerce explicitly: client_pause(timeout=int(my_value)).","If computing from seconds, round or truncate to an integer millisecond value first."],"exampleFix":"# before\nr.client_pause(timeout=500.0)\n# after\nr.client_pause(timeout=500)","handlingStrategy":"type-guard","validationCode":"if not isinstance(timeout, int):\n    timeout = int(timeout)\n# now safe","typeGuard":"def is_pause_timeout(v) -> bool:\n    return isinstance(v, int) and not isinstance(v, bool)","tryCatchPattern":null,"preventionTips":["client_pause timeout is an int number of milliseconds.","Be aware bool is a subclass of int in Python — True would pass isinstance(int) but is semantically wrong."],"tags":["client-management","validation","type-error","dataerror"],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}