Wait clearing the close channel (#8250)

Close channel should not be nilled before goroutines have exited.

Fixes potential hang on closing.
master
Klaus Post 5 years ago committed by Harshavardhana
parent 14b137aa66
commit 017456df63
  1. 2
      pkg/s3select/csv/reader.go

@ -106,8 +106,8 @@ func (r *Reader) Read(dst sql.Record) (sql.Record, error) {
func (r *Reader) Close() error { func (r *Reader) Close() error {
if r.close != nil { if r.close != nil {
close(r.close) close(r.close)
r.close = nil
r.readerWg.Wait() r.readerWg.Wait()
r.close = nil
} }
r.recordsRead = len(r.current) r.recordsRead = len(r.current)
if r.err == nil { if r.err == nil {

Loading…
Cancel
Save