Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup,restore: fix missing Close() calls #119625

Merged
merged 2 commits into from Feb 26, 2024
Merged

Conversation

dt
Copy link
Member

@dt dt commented Feb 25, 2024

Release note (bug fix): fixed a condition where some files were not closed when inspecting backup metadata during BACKUP and RESTORE.
Epic: none.

Release note (bug fix): fixed a condition where some files were not closed  when inspecting backup metadata during BACKUP and RESTORE.
Epic: none.
@dt dt added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. labels Feb 25, 2024
@dt dt requested a review from a team as a code owner February 25, 2024 16:01
Copy link

blathers-crl bot commented Feb 25, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Release note (bug fix): Fixed a bug where some backup metadata files opened during RESTORE were not closed.
Epic: none.
@dt dt changed the title backupccl: close LATEST file backup,restore: fix missing Close() calls Feb 25, 2024
Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be interesting to add something to our backup/restore unit tests that asserts that all open readers & writers have been closed.

@dt
Copy link
Member Author

dt commented Feb 26, 2024

Yeah, I played briefly with a mutex protected map in pkg/cloud to find these but it isn’t something I can merge in its current form.

Maybe a finalizer could be interesting?

anyway, targeted fix for now

@dt
Copy link
Member Author

dt commented Feb 26, 2024

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 26, 2024

Build succeeded:

@craig craig bot merged commit c6b9696 into cockroachdb:master Feb 26, 2024
15 of 22 checks passed
@dt dt deleted the latest-leak branch February 27, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants