Skip to content

Commit

Permalink
Merge pull request #711 from cybozu-go/issue-710
Browse files Browse the repository at this point in the history
issue-710: Do not kill system user
  • Loading branch information
shunki-fujita authored Jul 1, 2024
2 parents c545ebb + d7c7523 commit f0e84a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/dbop/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func (o *operator) KillConnections(ctx context.Context) error {
if p.Host == "localhost" {
continue
}
if p.User == "system user" {
continue
}

if _, err := o.db.ExecContext(ctx, `KILL CONNECTION ?`, p.ID); err != nil && !isNoSuchThread(err) {
return fmt.Errorf("failed to kill connection %d for %s from %s: %w", p.ID, p.User, p.Host, err)
Expand Down

0 comments on commit f0e84a3

Please sign in to comment.