Skip to content

Commit

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

// Close closes all executors and release all resources.
func (e *baseExecutor) Close() error {
for _, child := range e.children {
err := child.Close()
if err != nil {
return err
var firstErr error
for _, src := range e.children {
if err := src.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 5d6bda6

Please sign in to comment.