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

chore(client): add missing defer close in new snapshot command #16107

Merged
merged 1 commit into from
May 11, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented May 11, 2023

Description

The staticmajor job has been failing since #16067 because a defer close was forgotten.
https://github.com/cosmos/cosmos-sdk/actions/runs/4947335317/jobs/8846568187?pr=16104.
Already added in the mergify PRs, but this one is for main.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@julienrbrt julienrbrt requested a review from a team as a code owner May 11, 2023 11:53
@github-actions github-actions bot added the C:CLI label May 11, 2023
@julienrbrt julienrbrt changed the title chore(snapshot): add missing defer close in new snapshot command chore(client): add missing defer close in new snapshot command May 11, 2023
julienrbrt added a commit that referenced this pull request May 11, 2023
julienrbrt added a commit that referenced this pull request May 11, 2023
@@ -82,6 +82,7 @@
if err != nil {
return fmt.Errorf("failed to open chunk file %s: %w", path, err)
}
defer file.Close()

Check failure

Code scanning / gosec

Deferring unsafe method "Close" on type "net.Listener"

Deferring unsafe method "Close" on type "*os.File"
@julienrbrt julienrbrt marked this pull request as draft May 11, 2023 12:05
@julienrbrt julienrbrt marked this pull request as ready for review May 11, 2023 12:07
@julienrbrt julienrbrt added this pull request to the merge queue May 11, 2023
Merged via the queue into main with commit e6808cf May 11, 2023
@julienrbrt julienrbrt deleted the julien/fix-snapshot branch May 11, 2023 12:33
@@ -82,6 +82,7 @@
if err != nil {
return fmt.Errorf("failed to open chunk file %s: %w", path, err)
}
defer file.Close()

Check warning

Code scanning / CodeQL

Defer in loop

This defer statement is in a [loop](1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants