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(persistence): connection pool leak due to schema migrations #29

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

michaeladler
Copy link
Member

Description

Previously, a separate connection pool was created to execute schema migrations. This pool was not properly shut down though, leading to open connections and unused goroutines. This commit reuses the connection pool created for entgo, thereby preventing any resource leaks.

Issues Addressed

List and link all the issues addressed by this PR.

Change Type

Please select the relevant options:

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the CONTRIBUTING document.
  • My changes adhere to the established code style, patterns, and best practices.
  • I have added tests that demonstrate the effectiveness of my changes.
  • I have updated the documentation accordingly (if applicable).
  • I have added an entry in the CHANGELOG to document my changes (if applicable).

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #29 (2b0631a) into main (2e54f45) will increase coverage by 0.26%.
The diff coverage is 54.54%.

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   77.70%   77.97%   +0.26%     
==========================================
  Files          80       80              
  Lines        2983     2996      +13     
==========================================
+ Hits         2318     2336      +18     
+ Misses        487      481       -6     
- Partials      178      179       +1     
Files Changed Coverage Δ
internal/persistence/entgo/sqlite.go 54.28% <53.57%> (-0.89%) ⬇️
internal/persistence/entgo/mysql.go 64.00% <56.25%> (+8.18%) ⬆️

... and 2 files with indirect coverage changes

Previously, a separate connection pool was created to execute schema
migrations. This pool was not properly shut down though, leading to open
connections and unused goroutines. This commit reuses the connection
pool created for entgo, thereby preventing any resource leaks.

Signed-off-by: Michael Adler <[email protected]>
@stormc stormc merged commit 3f42f23 into siemens:main Aug 4, 2023
12 of 13 checks passed
@michaeladler michaeladler deleted the fix/connectionleak branch August 7, 2023 09:48
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