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

Fix a small connection leak #73

Closed

Conversation

pwnage101
Copy link
Contributor

This fixes a connection leak which causes open connections to accumulate
for each schema that gets refreshed. This probably doesn't manifest as
a user-facing bug, but it certainly can't hurt to merge a fix.

For an explanation on how I discovered and tested this, see the
following github issue comment:

#69 (comment)

@pwnage101 pwnage101 requested a review from a team as a code owner September 9, 2019 20:42
This fixes a connection leak which causes open connections to accumulate
for each schema that gets refreshed.  This probably doesn't manifest as
a user-facing bug, but it certainly can't hurt to merge a fix.

For an explanation on how I discovered and tested this, see the
following github issue comment:

Snowflake-Labs#69 (comment)
@@ -264,11 +264,13 @@ func SchemaExists(data *schema.ResourceData, meta interface{}) (bool, error) {
return false, err
}

exists := false
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it would be simpler to just use defer rows.Close()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll update tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually I did a pass to add this everywhere that I think is relevant- #74

@ryanking ryanking mentioned this pull request Sep 9, 2019
czimergebot pushed a commit that referenced this pull request Sep 9, 2019
[fix] close rows objectsWe were failing to close rows objects, leading to leaks and possibly lock-ups.

Fixes #73, #25
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.

2 participants