{"id":"8cf4105dda57105b","repo":"pika/pika","slug":"method-name-timed-out-after-timeout-seconds","errorCode":null,"errorMessage":"{method_name} timed out after {timeout} seconds","messagePattern":"(.+?) timed out after (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"pika/adapters/thread_safe_connection.py","lineNumber":477,"sourceCode":"\n            def _on_chan_close(ch, reason) -> None:\n                if not ready.is_set():\n                    if error[0] is None:\n                        error[0] = reason\n                    ready.set()\n\n            try:\n                self._channel.add_on_close_callback(_on_chan_close)\n                channel_method(*args, **kwargs, callback=_on_ok)\n            except Exception as exc:\n                error[0] = exc\n                ready.set()\n\n        self._wrapper.add_callback_threadsafe(_invoke)\n\n        try:\n            if not ready.wait(timeout=timeout):\n                raise TimeoutError(\n                    f'{method_name} timed out after {timeout} seconds')\n        finally:\n            self._unregister_waiter(ready, error)\n\n        if error[0] is not None:\n            raise error[0]\n        return result[0]\n\n    def basic_publish(self,\n                      exchange,\n                      routing_key,\n                      body,\n                      properties=None,\n                      mandatory: bool = False,\n                      on_publish=None) -> None:\n        \"\"\"\n        Schedule a publish in the IOLoop thread (fire-and-forget).\n","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/pika/pika/blob/295ad9e5795061d759b694ab1fcb33cd381d8c49/pika/adapters/thread_safe_connection.py#L459-L495","documentation":"Error \"{method_name} timed out after {timeout} seconds\" thrown in pika/pika.","triggerScenarios":"Thrown at pika/adapters/thread_safe_connection.py:477 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"295ad9e5795061d759b694ab1fcb33cd381d8c49","analyzedAt":"2026-08-04T20:47:41.389Z","schemaVersion":2}