{"record":{"id":"a0fb2000099693fc","repo":"ruvnet/ruflo","slug":"attempted-to-release-unknown-connection","errorCode":null,"errorMessage":"Attempted to release unknown connection","messagePattern":"Attempted to release unknown connection","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/shared/src/mcp/connection-pool.ts","lineNumber":239,"sourceCode":"\n      // Set timeout\n      setTimeout(() => {\n        const index = this.waitingClients.indexOf(client);\n        if (index !== -1) {\n          this.waitingClients.splice(index, 1);\n          reject(new Error(`Connection acquire timeout after ${this.config.acquireTimeout}ms`));\n        }\n      }, this.config.acquireTimeout);\n    });\n  }\n\n  /**\n   * Release a connection back to the pool\n   */\n  release(connection: PooledConnection): void {\n    const managed = this.connections.get(connection.id);\n    if (!managed) {\n      this.logger.warn('Attempted to release unknown connection', { id: connection.id });\n      return;\n    }\n\n    // Check for waiting clients first\n    const waitingClient = this.waitingClients.shift();\n    if (waitingClient) {\n      managed.acquire();\n      this.stats.totalAcquired++;\n      this.emit('pool:connection:acquired', { connectionId: connection.id });\n      waitingClient.resolve(managed);\n      return;\n    }\n\n    // Return to pool\n    managed.release();\n    this.stats.totalReleased++;\n\n    this.emit('pool:connection:released', { connectionId: connection.id });","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/shared/src/mcp/connection-pool.ts#L221-L257","documentation":"Guard in ConnectionPool.release(): the released connection's id is absent from the pool's managed set — either it was already released, evicted, or never acquired from this pool. The release is ignored (warn only) to avoid corrupting pool accounting; it usually indicates a double-release or foreign connection object.","triggerScenarios":"Thrown at v3/@claude-flow/shared/src/mcp/connection-pool.ts:239 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the caller to only release connections it acquired; releasing unknown connections indicates a lifecycle bug."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}