Skip to content

Commit

Permalink
executor: fix baseExecutor'children may not close (#11570) (#11598)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored and sre-bot committed Aug 5, 2019
1 parent 384e43a commit 6dfa63d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ func (e *baseExecutor) Open(ctx context.Context) error {

// Close closes all executors and release all resources.
func (e *baseExecutor) Close() error {
var firstErr error
for _, child := range e.children {
err := child.Close()
if err != nil {
return errors.Trace(err)
if err := child.Close(); err != nil && firstErr == nil {
firstErr = err
}
}
return nil
return firstErr
}

// Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.
Expand Down

0 comments on commit 6dfa63d

Please sign in to comment.