Skip to content

fix(error_index): close parquet file after object-storage upload - #7232

Open
Ayush7614 wants to merge 1 commit into
rudderlabs:masterfrom
Ayush7614:fix/error-index-close-upload-file
Open

fix(error_index): close parquet file after object-storage upload#7232
Ayush7614 wants to merge 1 commit into
rudderlabs:masterfrom
Ayush7614:fix/error-index-close-upload-file

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • uploadPayloads reopened the parquet file for object-storage upload but never closed it on success or failure, leaking one FD per error-index flush
  • Also closes the create handle if parquet encoding fails before the explicit Close
  • Adds unit tests that assert writing to the upload *os.File fails after uploadPayloads returns (proves the FD was closed)

Test plan

  • go test ./enterprise/reporting/error_index/ -run 'TestUploadPayloadsClosesFile' -v
  • go test ./enterprise/reporting/error_index/ -run 'TestWorkerWriter/writer/writes$' -v

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

uploadPayloads reopened the parquet file for upload but never closed it
on success or failure, leaking one FD per error-index flush. Also close
the create handle if encode fails before the explicit Close call.
@contributor-support

Copy link
Copy Markdown

Thank you @Ayush7614 for contributing this PR.
Please sign the Contributor License Agreement (CLA) before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant