Repository navigation
fix(warehouse): close load file descriptor in identity uploadFile - #7186
Merged
achettyiitr merged 2 commits intoAug 17, 2026
Merged
Conversation
The load file opened in uploadFile() was never closed on any path, leaking two file descriptors per identity-resolution sync. Also return an error instead of panicking when the file cannot be opened, matching the error handling of the rest of the function. Resolves rudderlabs#7185
|
Thank you @andyosyndoh for contributing this PR. |
|
diff --git a/warehouse/identity/identity.go b/warehouse/identity/identity.go
|
achettyiitr
approved these changes
Aug 17, 2026
krishna2020
reviewed
Aug 17, 2026
krishna2020
approved these changes
Aug 17, 2026
Member
|
Everything looks good, merging then. #7279 |
atzoum
added a commit
that referenced
this pull request
Aug 18, 2026
# Description Syncing release v1.83.0 to main branch **WARNING: Do NOT rewrite git history and ALWAYS use a "Merge Commit" for merging!** **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix(warehouse): close load file descriptor in identity uploadFile (#7186) END_COMMIT_OVERRIDE
This was referenced Aug 24, 2026
Merged
itsmihir
pushed a commit
that referenced
this pull request
Aug 24, 2026
🤖 I have created a release *beep* *boop* --- ## [1.84.0-rc.1](v1.83.0...v1.84.0-rc.1) (2026-08-24) ### Features * add AGENTS.md for agent management and reference ([#7290](#7290)) ([2d28b32](2d28b32)) * **processor:** report duplicate events as dedup/filtered metrics ([#7280](#7280)) ([f2655fb](f2655fb)) * **warehouse:** add clickhouse driver interface ([#7296](#7296)) ([239d9a4](239d9a4)) ### Bug Fixes * **processor:** proc destination hydration omitted destination's original id ([#7297](#7297)) ([f389df4](f389df4)) * **warehouse:** close load file descriptor in identity uploadFile ([#7186](#7186)) ([bfd8bc9](bfd8bc9)) ### Miscellaneous * handle oversized reporting payloads ([#7293](#7293)) ([7a83281](7a83281)) * pyt security hardening ([#7272](#7272)) ([e13b731](e13b731)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir
pushed a commit
that referenced
this pull request
Aug 25, 2026
🤖 I have created a release *beep* *boop* --- ## [1.84.0](v1.83.0...v1.84.0) (2026-08-24) ### Features * add AGENTS.md for agent management and reference ([#7290](#7290)) ([2d28b32](2d28b32)) * **processor:** report duplicate events as dedup/filtered metrics ([#7280](#7280)) ([f2655fb](f2655fb)) * **warehouse:** add clickhouse driver interface ([#7296](#7296)) ([239d9a4](239d9a4)) ### Bug Fixes * **processor:** proc destination hydration omitted destination's original id ([#7297](#7297)) ([f389df4](f389df4)) * **warehouse:** close load file descriptor in identity uploadFile ([#7186](#7186)) ([bfd8bc9](bfd8bc9)) ### Miscellaneous * handle oversized reporting payloads ([#7293](#7293)) ([7a83281](7a83281)) * pyt security hardening ([#7272](#7272)) ([e13b731](e13b731)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
uploadFile()inwarehouse/identity/identity.goopened the load file for object-storage upload but never closed the file descriptor — on the filemanager-creation error path, the upload error path, or on success. SinceuploadFile()runs twice per identity-resolution sync (merge rules + identity mappings), every sync leaked two file descriptors for the lifetime of the process, contributing to fd exhaustion (too many open files) under sustained syncing.This PR:
defer func() { _ = outputFile.Close() }()immediately after theos.Open, matching the pattern used elsewhere in the package (identity.gotableRows.Close()) and inwarehouse/validations/validate.gopanic(err)on open failure with a wrapped error return, consistent with every other error path in the functionSame defect class as #7071 (batchrouter), but in the identity-resolution flow.
Resolves #7185
Linear Ticket
N/A — community contribution, tracked in GitHub issue #7185
Security