Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#4413 from tinyspeck/fix-for-vtexplain
Browse files Browse the repository at this point in the history
Fix for vtexplain
  • Loading branch information
demmer authored Dec 5, 2018
2 parents e8c8a78 + b654418 commit 3f5a312
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions go/cmd/vtexplain/vtexplain.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func getFileParam(flag, flagFile, name string) (string, error) {
}

func main() {
defer vtexplain.Stop()
defer exit.RecoverAll()
defer logutil.Flush()

Expand Down Expand Up @@ -178,7 +179,5 @@ func parseAndRun() error {
fmt.Print(vtexplain.ExplainsAsJSON(plans))
}

vtexplain.Stop()

return nil
}
3 changes: 3 additions & 0 deletions go/vt/vtexplain/vtexplain.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func Init(vSchemaStr, sqlSchema string, opts *Options) error {
func Stop() {
// Cleanup all created fake dbs.
if explainTopo != nil {
for _, conn := range explainTopo.TabletConns {
conn.tsv.StopService()
}
for _, conn := range explainTopo.TabletConns {
conn.db.Close()
}
Expand Down

0 comments on commit 3f5a312

Please sign in to comment.