Description
Component(s)
disk-buffering
What happened?
Description
On Windows systems, the exportStoredBatch
method returns true
when a file exists in the buffer directory. However, once the file is fully read, the subsequent file.delete()
call in cleanUp()
fails silently—returning false
but not handled by the code. As a result, the same file is repeatedly re-exported on each exportStoredBatch
call until a new file is written, leading to redundant exports and significant load on backend APIs.
This behavior appears linked to how Windows handles file deletion. After file.delete()
is called, the file’s metadata may reflect 0KB, but the contents persist until a subsequent I/O operation (e.g., file creation) triggers actual cleanup. This suggests possible lazy deletion by the Windows OS, though further investigation at the kernel level would be needed to confirm.
Steps to Reproduce
Deploy your code on Windows with debugEnabled
set to true, and you'll consistently see the message Now exporting batch of ...
repeated.
Expected Result
The file must be deleted and should not be re-exported.
Actual Result
The file is repeatedly processed and exported.
Component version
v1.39.0
Log output
No response
Additional context
No response