Skip to content

Commit

Permalink
executor: Close() executors when Open() returns an error to avoid gor…
Browse files Browse the repository at this point in the history
…outine leak (#5469) (#5486)
  • Loading branch information
tiancaiamao authored and coocood committed Dec 25, 2017
1 parent 9b9f5f9 commit 2cccadc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func (a *ExecStmt) Exec(ctx context.Context) (ast.RecordSet, error) {
}

if err := e.Open(); err != nil {
terror.Call(e.Close)
return nil, errors.Trace(err)
}

Expand Down

0 comments on commit 2cccadc

Please sign in to comment.