{"record":{"id":"08870ef514300087","repo":"canopy-network/canopy","slug":"request-timeout-for-id-requestid","errorCode":null,"errorMessage":"Request timeout for id $requestId","messagePattern":"Request timeout for id \\$requestId","errorType":"exception","errorClass":"kotlin.Exception","httpStatus":null,"severity":"error","filePath":"plugin/kotlin/src/main/kotlin/com/canopy/plugin/PluginClient.kt","lineNumber":317,"sourceCode":"        val requestId = msg.id\n        val pendingResponse = PendingResponse()\n\n        lock.withLock {\n            pending[requestId] = pendingResponse\n            if (contract != null) {\n                requestContract[requestId] = contract\n            }\n        }\n\n        sendMessage(msg)\n\n        // Wait for response with timeout\n        if (!pendingResponse.lock.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)) {\n            lock.withLock {\n                pending.remove(requestId)\n                requestContract.remove(requestId)\n            }\n            throw Exception(\"Request timeout for id $requestId\")\n        }\n\n        return pendingResponse.response ?: throw Exception(\"No response received for id $requestId\")\n    }\n\n    /**\n     * Send response to FSM\n     */\n    private fun sendResponse(id: Long, builder: PluginToFSM.Builder) {\n        val msg = builder.setId(id).build()\n        sendMessage(msg)\n    }\n\n    /**\n     * Send protobuf message with length prefix\n     */\n    private fun sendMessage(msg: PluginToFSM) {\n        val bytes = msg.toByteArray()","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/canopy-network/canopy/blob/ee8197d91dd410f6592cb650a94c925ee6dc8bad/plugin/kotlin/src/main/kotlin/com/canopy/plugin/PluginClient.kt#L299-L335","documentation":"Thrown in PluginClient.sendSync when the registered PendingResponse latch is not released within TIMEOUT_SECONDS after the message is sent. The FSM never replied (crash, hang, lost frame, or slow processing), so the pending entry is removed and the caller gets a timeout carrying the request id.","triggerScenarios":"Thrown at plugin/kotlin/src/main/kotlin/com/canopy/plugin/PluginClient.kt:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check FSM health/logs for crashes or stalled processing at the time of the request.","Retry the request; if timeouts recur, increase TIMEOUT_SECONDS or investigate transport latency.","Ensure the FSM is not dropping messages for the plugin's connection."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ee8197d91dd410f6592cb650a94c925ee6dc8bad","analyzedAt":"2026-09-06T09:30:15.973Z","contentChangedAt":"2026-09-06T09:30:15.973Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}