fix: resolve database connection leak issue in ORM extension#827
Merged
LinuxSuRen merged 6 commits intoLinuxSuRen:masterfrom Sep 16, 2025
Merged
fix: resolve database connection leak issue in ORM extension#827LinuxSuRen merged 6 commits intoLinuxSuRen:masterfrom
LinuxSuRen merged 6 commits intoLinuxSuRen:masterfrom
Conversation
|
Jai Raj Choudhary seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
added 4 commits
September 12, 2025 17:52
- Add thread-safe mutex protection to MockORMStore - Improve goroutine cleanup with proper channel handling - Add timeout protection to prevent test hanging - Address SonarQube reliability concerns in concurrent tests
- Replace defer cancel() with explicit cancel() calls - Cancel context immediately after each test iteration - Prevent context accumulation in tight loops - Address SonarQube reliability rating C -> A
- Use defer cancel() for consistent context cleanup - Removes manual cancel() calls in error paths - Ensures context is always properly cleaned up - Addresses SonarQube reliability concerns
LinuxSuRen
requested changes
Sep 13, 2025
Owner
LinuxSuRen
left a comment
There was a problem hiding this comment.
Thanks for your time. But there are a few small issues you might need to handle.
LinuxSuRen
reviewed
Sep 16, 2025
Owner
There was a problem hiding this comment.
hi @jairajc , thanks for your effort. Everything is ok except the following you need to handle before merging this PR.
- Please use your email that connects to your GitHub account
- Please feel free to complete the CLA according to the instructions
9e06867 to
ebf59f0
Compare
ebf59f0 to
fd94a1b
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What type of PR is this?
fix: database connection leak in ORM extension
What this PR does / why we need it:
This PR addresses a critical database connection leak issue in the atest-ext-store-orm extension that causes "too many connections" errors when switching between different database configurations in production environments.
Key Changes:
cmd/run.goby properly handling context cancellation with deferTechnical Details:
The root cause was identified in the ORM extension's
getClientWithDatabasemethod where cache keys only used database names, causing connection conflicts when switching between different store configurations pointing to the same database. The fix implements proper connection pooling, thread-safe caching, and composite cache keys.Impact:
Which issue(s) this PR fixes:
Addresses database connection leak issues reported in production environments when using multiple database configurations with the ORM extension.