Andrea Cosentino created CAMEL-24530:
----------------------------------------
Summary: camel-djl: DJLConverter leaks the InputStream opened from
File/Path bodies
Key: CAMEL-24530
URL: https://issues.apache.org/jira/browse/CAMEL-24530
Project: Camel
Issue Type: Bug
Components: camel-ai
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.23.0
DJLConverter.toImage(File)/toImage(Path)/toAudio(File)/toAudio(Path) open a
stream (new FileInputStream / Files.newInputStream) and pass it to
ImageFactory/AudioFactory.fromInputStream, which does not close it, with no
try-with-resources. A DJL route with a File/Path body (common for image/audio
input) leaks a file descriptor per exchange, exhausting FDs under load. The
byte[] overloads wrap ByteArrayInputStream and are harmless.
Fix: wrap the file/path opens in try-with-resources.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)