Skip to content

Commit

Permalink
servenv: Remove double close() logic (#14457)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirkjan Bussink <[email protected]>
Signed-off-by: deepthi <[email protected]>
Co-authored-by: deepthi <[email protected]>
  • Loading branch information
dbussink and deepthi authored Nov 4, 2023
1 parent 366f7d2 commit 9e80138
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions go/cmd/mysqlctld/cli/mysqlctld.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ var (
Long: "`mysqlctld` is a gRPC server that can be used instead of the `mysqlctl` client tool.\n" +
"If the target directories are empty when it is invoked, it automatically performs initialization operations to bootstrap the `mysqld` instance before starting it.\n" +
"The `mysqlctld` process can subsequently receive gRPC commands from a `vttablet` to perform housekeeping operations like shutting down and restarting the `mysqld` instance as needed.\n\n" +

"{{< warning >}}\n" +
"`mysqld_safe` is not used so the `mysqld` process will not be automatically restarted in case of a failure.\n" +
"{{</ warning>}}\n\n" +
Expand Down Expand Up @@ -151,7 +150,6 @@ func run(cmd *cobra.Command, args []string) error {
cancel()

servenv.Init()
defer servenv.Close()

// Take mysqld down with us on SIGTERM before entering lame duck.
servenv.OnTermSync(func() {
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtaclcheck/cli/vtactlcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ var (

func run(cmd *cobra.Command, args []string) error {
servenv.Init()
defer servenv.Close()

opts := &vtaclcheck.Options{
ACLFile: aclFile,
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtbackup/cli/vtbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func init() {

func run(_ *cobra.Command, args []string) error {
servenv.Init()
defer servenv.Close()

ctx, cancel := context.WithCancel(context.Background())
servenv.OnClose(func() {
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtbench/cli/vtbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func run(cmd *cobra.Command, args []string) error {
_ = cmd.Flags().Set("logtostderr", "true")

servenv.Init()
defer servenv.Close()

var clientProto vtbench.ClientProtocol
switch protocol {
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtctld/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ This is demonstrated in the example usage below.`,

func run(cmd *cobra.Command, args []string) error {
servenv.Init()
defer servenv.Close()

ts = topo.Open()
defer ts.Close()
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vtgate/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ func run(cmd *cobra.Command, args []string) error {
defer exit.Recover()

servenv.Init()
defer servenv.Close()

ts := topo.Open()
defer ts.Close()
Expand Down
1 change: 0 additions & 1 deletion go/cmd/vttablet/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ vttablet \

func run(cmd *cobra.Command, args []string) error {
servenv.Init()
defer servenv.Close()

tabletAlias, err := topoproto.ParseTabletAlias(tabletPath)
if err != nil {
Expand Down
5 changes: 0 additions & 5 deletions go/vt/servenv/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ func Run(bindAddress string, port int) {

log.Info("Shutting down gracefully")
fireOnCloseHooks(onCloseTimeout)
}

// Close runs any registered exit hooks in parallel.
func Close() {
onCloseHooks.Fire()
ListeningURL = url.URL{}
}

Expand Down

0 comments on commit 9e80138

Please sign in to comment.