You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/10/30 05:26:00 UTC

[jira] [Closed] (OFBIZ-13770) RecordIterator leaves the URL stream open when it cannot be created, and drops the cause

     [ https://issues.apache.org/jira/browse/OFBIZ-13770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak closed OFBIZ-13770.
---------------------------------
    Fix Version/s: Upcoming Branch
                   24.09.09
       Resolution: Fixed

> RecordIterator leaves the URL stream open when it cannot be created, and drops the cause
> ----------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13770
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13770
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Upcoming Branch, 24.09.08
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Minor
>             Fix For: Upcoming Branch, 24.09.09
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When RecordIterator is created from a URL, it opens the stream and then reads the start of the file. If that fails, the constructor throws a DataFileException but never closes the stream it opened. It can fail on an unknown encoding, an IOException while skipping the configured start lines, or a first record that matches no record definition. The connection stays open until garbage collection. The "is not supported" and "Impossible to read the buffer" exceptions also drop the underlying exception, so the log doesn't show why the file couldn't be read.
> h3. Proposed fix
> In the URL constructor, close the stream and rethrow when the setup fails. Pass the original exception as the cause in both places.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)