{"record":{"id":"d92a94cd01aebc62","repo":"apache/hadoop","slug":"keepalivecache-is-closed","errorCode":null,"errorMessage":"KeepAliveCache is closed","messagePattern":"KeepAliveCache is closed","errorType":"exception","errorClass":"ClosedIOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/KeepAliveCache.java","lineNumber":208,"sourceCode":"    while (size() != 0) {\n      closeHttpClientConnection(pollFirst());\n    }\n  }\n\n  /**\n   * Gets the oldest added HttpClientConnection from the cache. The returned connection\n   * is open.\n   * The cache follows the FIFO strategy. If the connection is not open, it will\n   * be closed and the next connection is checked. Once a valid connection is found,\n   * it is returned.\n   * @return HttpClientConnection: if a valid connection is found, else null.\n   * @throws IOException if the cache is closed.\n   */\n  public HttpClientConnection get() throws IOException {\n    if (getIsClosed()) {\n      LOG.debug(\"Attempt to get connection from closed cache for account: {}\",\n          accountNamePath);\n      throw new ClosedIOException(accountNamePath, KEEP_ALIVE_CACHE_CLOSED);\n    }\n    HttpClientConnection httpClientConnection;\n    while ((httpClientConnection = pollFirst()) != null) {\n      if (!httpClientConnection.isOpen() || httpClientConnection.isStale()) {\n        closeHttpClientConnection(httpClientConnection);\n        continue;\n      }\n      return httpClientConnection;\n    }\n    LOG.debug(\"No valid connection found in cache for account: {}\",\n        accountNamePath);\n    return null;\n  }\n\n  /**\n   * Puts the HttpClientConnection in the cache. If the size of cache is equal to\n   * maxConn, the oldest connection is closed and removed from the cache, which\n   * will make space for the new connection. If the cache is closed or of zero size,","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/KeepAliveCache.java#L190-L226","documentation":"Error \"KeepAliveCache is closed\" thrown in apache/hadoop.","triggerScenarios":"Code attempts to reuse the keep-alive cache after the ABFS client shut it down.","commonSituations":"See trigger scenarios.","solutions":["Do not use the HTTP connection keep-alive cache after the filesystem/client is closed.","Open a new filesystem instance for further operations."],"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"}