> On Nov 11, 2026, at 23:55, Fujii Masao <[email protected]> wrote:
>
> On Wed, Nov 11, 2026 at 7:52 PM Chao Li <[email protected]> wrote:
>> Which bypasses the operations for successful close(df->fd), is that
>> intentional?
>
> Yes. Previously, if compression finalization or the final write failed,
> the function returned -1 immediately, skipping rename, unlink, and
> sync. So the patch just preserves that behavior while releasing
> the resources.
>
> Regards,
>
> --
> Fujii Masao
It’s true that the previous code returned -1 immediately on LZ4F_isError,
causing the fd leak that this patch fixes. But I think that also cause a
temporary file leak. In writeTimeLineHistoryFile(), there is a call:
```
/*
* If we fail to make the file, delete it to release disk space
*/
stream->walmethod->ops->close(f, CLOSE_UNLINK);
```
This call is intended to delete a temporary file, so I don’t think an LZ4F
error should prevent that deletion. Maybe fix this leak as well?
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/