{"record":{"id":"dac1f00179eaba5d","repo":"apache/hadoop","slug":"connection-pool-error","errorCode":null,"errorMessage":"Connection pool error.","messagePattern":"Connection pool error\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPConnectionPool.java","lineNumber":66,"sourceCode":"  private HashMap<ChannelSftp, ConnectionInfo> con2infoMap =\n      new HashMap<ChannelSftp, ConnectionInfo>();\n\n  SFTPConnectionPool(int maxConnection) {\n    this.maxConnection = maxConnection;\n  }\n\n  synchronized ChannelSftp getFromPool(ConnectionInfo info) throws IOException {\n    Set<ChannelSftp> cons = idleConnections.get(info);\n    ChannelSftp channel;\n\n    if (cons != null && cons.size() > 0) {\n      Iterator<ChannelSftp> it = cons.iterator();\n      if (it.hasNext()) {\n        channel = it.next();\n        idleConnections.remove(info);\n        return channel;\n      } else {\n        throw new IOException(\"Connection pool error.\");\n      }\n    }\n    return null;\n  }\n\n  /** Add the channel into pool.\n   * @param channel\n   */\n  synchronized void returnToPool(ChannelSftp channel) {\n    ConnectionInfo info = con2infoMap.get(channel);\n    HashSet<ChannelSftp> cons = idleConnections.get(info);\n    if (cons == null) {\n      cons = new HashSet<>();\n      idleConnections.put(info, cons);\n    }\n    cons.add(channel);\n\n  }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPConnectionPool.java#L48-L84","documentation":"Error \"Connection pool error.\" thrown in apache/hadoop.","triggerScenarios":"Thrown by SFTPConnectionPool when it fails to borrow or return a connection from the pool, e.g. pool exhaustion or an interrupted wait.","commonSituations":"See trigger scenarios.","solutions":["Check SFTP server reachability and credentials; the connection pool failed to provide a session.","Increase pool capacity or fix the underlying connection error reported in the cause."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}