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

Ensure close() is called on result of pandas.read_sql(chunksize=...) #150

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

vinceatbluelabs
Copy link
Contributor

@vinceatbluelabs vinceatbluelabs commented Dec 9, 2020

While writing new integration tests in #140, I started hitting frozen tests and 'too many open connection' errors from Redshift. The patch inside this PR fixed it - it appears that we were not closing the SQL connection opened while reading chunked dataframes, which resulted in simultaneous connections piling up and table locks in the integration tests.

@vinceatbluelabs vinceatbluelabs marked this pull request as ready for review December 10, 2020 00:22
Copy link
Contributor

@cwegrzyn cwegrzyn left a comment

Choose a reason for hiding this comment

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

Ah, didn't know about generator close. But, interesting! :shipit:

@vinceatbluelabs vinceatbluelabs merged commit 9f269a7 into master Dec 10, 2020
@vinceatbluelabs vinceatbluelabs deleted the ensure_db_connection_closed branch December 10, 2020 16:23
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