bug(export): BaseExporter.multi leaks InputStream[] on error path
Author: Aias00Created Aug 4, 2026Updated Sep 17, 2026
Description
BaseExporter.multi allocates InputStream[] inputStreams and opens one per table in a loop (FileUtil.getInputStream), then calls ZipUtil.zip. There is no try/finally. If singleExport or getInputStream throws at i>0, the streams at 0..i-1 are leaked. (On the success path, Hutool's ZipUtil.zip closes them; the finally is safe because InputStream.close() is idempotent.)
Location
chat2db-community-domain-core/.../task/export/BaseExporter.java:50-68
Impact
File-handle leak on every multi-table export failure; repeated failures exhaust handles.
Suggested fix
Wrap the loop + ZipUtil.zip in try/finally that closes all non-null inputStreams.
Related existing
None.
Source: OtterMind/Chat2DB