Skip to content

Commit

Permalink
set max pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Dec 10, 2023
1 parent 350bb86 commit 6d42fa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion flow/connectors/postgres/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func (c *PostgresConnector) GetSlotInfo(slotName string) ([]*protos.SlotInfo, er
FROM
pg_control_checkpoint(),
pg_replication_slots`+specificSlotClause+`;`)

if err != nil {
return nil, err
}
Expand Down
3 changes: 3 additions & 0 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func NewPostgresConnector(ctx context.Context, pgConfig *protos.PostgresConfig)
runtimeParams["idle_in_transaction_session_timeout"] = "0"
runtimeParams["statement_timeout"] = "0"

// set pool size to 3 to avoid connection pool exhaustion
connConfig.MaxConns = 3

pool, err := pgxpool.NewWithConfig(ctx, connConfig)
if err != nil {
return nil, fmt.Errorf("failed to create connection pool: %w", err)
Expand Down

0 comments on commit 6d42fa2

Please sign in to comment.