Skip to content

Commit

Permalink
Rename terminationGracePeriodSeconds constant
Browse files Browse the repository at this point in the history
Signed-off-by: Yohei Yoshimuta <[email protected]>
  • Loading branch information
yoheimuta committed Nov 30, 2023
1 parent 8bb2c00 commit befb94e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/operator/vttablet/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ const (
serviceMap = "grpc-queryservice,grpc-tabletmanager,grpc-updatestream"
healthCheckInterval = 5 * time.Second

// terminationGracePeriodSeconds is how long Kubernetes will wait for the
// defaultTerminationGracePeriodSeconds is how long Kubernetes will wait for the
// tablet processes (vttablet, mysqlctld) to terminate gracefully after
// sending SIGTERM, before resorting to SIGKILL. We set this fairly high
// because mysqld needs time to flush buffers to disk in order to shut down
// cleanly.
terminationGracePeriodSeconds = 30 * 60 // 30min
defaultTerminationGracePeriodSeconds = 30 * 60 // 30min

grpcMaxMessageSize = 64 * 1024 * 1024 // 64 MiB

Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/vttablet/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func UpdatePod(obj *corev1.Pod, spec *Spec) {
if spec.Vttablet.TerminationGracePeriodSeconds != nil {
obj.Spec.TerminationGracePeriodSeconds = spec.Vttablet.TerminationGracePeriodSeconds
} else {
obj.Spec.TerminationGracePeriodSeconds = pointer.Int64Ptr(terminationGracePeriodSeconds)
obj.Spec.TerminationGracePeriodSeconds = pointer.Int64Ptr(defaultTerminationGracePeriodSeconds)
}

// In both the case of the user injecting their own affinity and the default, we
Expand Down

0 comments on commit befb94e

Please sign in to comment.