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: DB sessions are recreated whenever controller configmap updates. Fixes #10498 #10734

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

terrytangyuan
Copy link
Member

Fixes #10498. The issue is that after change b0f0c58 introduced in 3.4.5, new DB sessions are re-created every time when the configmap changes. This PR allows reusing the DB session.

@@ -152,3 +142,13 @@ func CreateMySQLDBSession(kubectlConfig kubernetes.Interface, namespace string,
}
return session, cfg.TableName, nil
}

// ConfigureDBSession configures the DB session
func ConfigureDBSession(session sqlbuilder.Database, persistPool *config.ConnectionPool) sqlbuilder.Database {
Copy link
Member Author

@terrytangyuan terrytangyuan Mar 22, 2023

Choose a reason for hiding this comment

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

This is a separate function because once we reused a session, we still want to update the configurations based on configmap changes in updateConfig().

Signed-off-by: Yuan Tang <[email protected]>
Signed-off-by: Yuan Tang <[email protected]>
@terrytangyuan terrytangyuan enabled auto-merge (squash) March 23, 2023 21:32
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.

Workflow Archive database connections are not closed
2 participants