{"record":{"id":"48ef46fb4c7c19f7","repo":"apache/druid","slug":"failed-to-close-payload-for-segmente-pulled-from","errorCode":null,"errorMessage":"Failed to close payload for segmente pulled from [%s]","messagePattern":"Failed to close payload for segmente pulled from \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesDataSegmentPuller.java","lineNumber":79,"sourceCode":"      try {\n        FileUtils.deleteDirectory(outDir);\n      }\n      catch (IOException ioe) {\n        log.warn(\n            ioe,\n            \"Failed to remove output directory [%s] for segment pulled from [%s]\",\n            outDir.getAbsolutePath(),\n            path\n        );\n      }\n      throw new SegmentLoadingException(e, e.getMessage());\n    }\n    finally {\n      try {\n        byteSource.closeStream();\n      }\n      catch (IOException ioe) {\n        log.warn(ioe, \"Failed to close payload for segmente pulled from [%s]\", path);\n      }\n    }\n  }\n}\n","sourceCodeStart":61,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/cloudfiles-extensions/src/main/java/org/apache/druid/storage/cloudfiles/CloudFilesDataSegmentPuller.java#L61-L84","documentation":"CloudFilesDataSegmentPuller.getSegmentFiles() closes the CloudFiles byte source stream in a finally block; if closeStream() throws IOException it logs this warning. The segment load result is unaffected — this only indicates the HTTP/storage connection was not closed cleanly, which can leak connections over time.","triggerScenarios":"closeStream() on the CloudFiles ByteSource fails — typically the underlying HTTP connection to Rackspace was already broken/reset, so closing the stream also errors.","commonSituations":"Flaky network or Rackspace endpoint resets mid/after transfer; long-running historicals accumulating leaked connections; aggressive firewalls dropping idle connections.","solutions":["Verify network stability between Druid and the Cloud Files endpoint","Reproduce frequency via logs; occasional occurrences can be ignored","Upgrade the storage extension/druid-jersey stack to get connection-pool fixes","Check provider-level connection pool/timeout settings for the rackspace cloudfiles client"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  puller.getSegmentFiles(descriptor);\n} catch (SegmentLoadingException e) {\n  // primary failure handled here\n}\n// close warning is non-fatal; monitor for frequency to detect connection leaks","preventionTips":["Keep network paths to Cloud Files stable; check firewall idle-connection drops","Tune the rackspace/cloudfiles HTTP client connection pool and timeouts","Watch for rising counts of this warning — it can indicate connection leaks","Upgrade to a Druid version with stream-close fixes in cloudfiles extension"],"tags":["cloudfiles","rackspace","io","resource-cleanup"],"backgroundTag":"broken-pipe","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}