mirror of
https://github.com/minio/minio.git
synced 2025-01-26 22:23:15 -05:00
Wait clearing the close channel (#8250)
Close channel should not be nilled before goroutines have exited. Fixes potential hang on closing.
This commit is contained in:
parent
14b137aa66
commit
017456df63
@ -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…
x
Reference in New Issue
Block a user