From 5ba016e1235eaef5b9a4e44078ebfc44f009bd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 25 Sep 2025 09:46:06 +0200 Subject: [PATCH] fix(rt): release client after migration (#10788) # Which Problems Are Solved Relation table migrations do not release the client after migrations are done. # How the Problems Are Solved Defer releasing of the client after acquire. # Additional Changes - rename two filenames with typos. # Additional Context - none --- .../postgres/migration/{migrationgs.go => migrations.go} | 0 .../migration/{migrationgs_test.go => migrations_test.go} | 0 backend/v3/storage/database/dialect/postgres/pool.go | 2 ++ 3 files changed, 2 insertions(+) rename backend/v3/storage/database/dialect/postgres/migration/{migrationgs.go => migrations.go} (100%) rename backend/v3/storage/database/dialect/postgres/migration/{migrationgs_test.go => migrations_test.go} (100%) diff --git a/backend/v3/storage/database/dialect/postgres/migration/migrationgs.go b/backend/v3/storage/database/dialect/postgres/migration/migrations.go similarity index 100% rename from backend/v3/storage/database/dialect/postgres/migration/migrationgs.go rename to backend/v3/storage/database/dialect/postgres/migration/migrations.go diff --git a/backend/v3/storage/database/dialect/postgres/migration/migrationgs_test.go b/backend/v3/storage/database/dialect/postgres/migration/migrations_test.go similarity index 100% rename from backend/v3/storage/database/dialect/postgres/migration/migrationgs_test.go rename to backend/v3/storage/database/dialect/postgres/migration/migrations_test.go diff --git a/backend/v3/storage/database/dialect/postgres/pool.go b/backend/v3/storage/database/dialect/postgres/pool.go index 275be54e11e..25a2caa39e3 100644 --- a/backend/v3/storage/database/dialect/postgres/pool.go +++ b/backend/v3/storage/database/dialect/postgres/pool.go @@ -86,6 +86,7 @@ func (p *pgxPool) Migrate(ctx context.Context) error { if err != nil { return err } + defer client.Release() err = migration.Migrate(ctx, client.Conn()) isMigrated = err == nil @@ -98,6 +99,7 @@ func (p *pgxPool) MigrateTest(ctx context.Context) error { if err != nil { return err } + defer client.Release() err = migration.Migrate(ctx, client.Conn()) isMigrated = err == nil