Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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