Skip to content

Commit

Permalink
xorm client mutex global access added
Browse files Browse the repository at this point in the history
  • Loading branch information
HiranmoyChowdhury committed Apr 29, 2024
1 parent dc56db9 commit aafb845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgbouncer/kubedb_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func GetXormClientList(kc client.Client, pb *api.PgBouncer, ctx context.Context)
}
func (l *XormClientList) addXormClient(kc client.Client, pb *api.PgBouncer, ctx context.Context, podName string, postgresRef *api.Databases, c chan string, pgReplica int) {
xormClient, err := NewKubeDBClientBuilder(kc, pb).WithContext(ctx).WithDatabaseRef(postgresRef).WithPod(podName).GetPgBouncerXormClient()
l.mutex.Lock()
defer l.mutex.Unlock()
l.Mutex.Lock()
defer l.Mutex.Unlock()
if err != nil {
klog.V(5).ErrorS(err, fmt.Sprintf("failed to create xorm client for pgbouncer %s/%s to make pool with postgres pod %s/%s", pb.Namespace, pb.Name, postgresRef.DatabaseRef.Namespace, postgresRef.DatabaseRef.Name))
l.List = append(l.List, nil)
Expand Down

0 comments on commit aafb845

Please sign in to comment.