Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not exit go-routine upon ctx.Done() on receiver side #1679

Merged
merged 1 commit into from
Jul 24, 2022

Conversation

harshavardhana
Copy link
Member

If there are concurrent callers sharing a context, it may
happen that while the "reqCh" gets a "send" attempt, context
might be closed and returning.

If there are concurrent callers sharing a context, it may
happen that while the "reqCh" gets a "send" attempt, context
might be closed and returning.
@harshavardhana
Copy link
Member Author

This fixes a bug

panic: send on closed channel

goroutine 797459 [running]:
github.com/minio/minio-go/v7.(*Object).doGetRequest(_, {{0xc01a2dc000, 0x2000, 0x2000}, 0xba2000, 0x0, 0x1, 0x0, 0x1, 0x0, ...})
        github.com/minio/minio-go/v7@v7.0.31/api-get-object.go:319 +0xdc
github.com/minio/minio-go/v7.(*Object).Read(0xc06c571180, {0xc01a2dc000?, 0x1c0?, 0xc004002400?})
        github.com/minio/minio-go/v7@v7.0.31/api-get-object.go:399 +0x248
io.discard.ReadFrom({}, {0x4cd0e20, 0xc06c571180})
        io/io.go:610 +0x72
io.copyBuffer({0x4cd7d80, 0x6023d20}, {0x4cd0e20, 0xc06c571180}, {0x0, 0x0, 0x0})
        io/io.go:412 +0x14b
io.Copy(...)
        io/io.go:385
github.com/minio/minio/cmd.selfSpeedTest.func4(0x8)
        github.com/minio/minio/cmd/perf-tests.go:149 +0x3f5
created by github.com/minio/minio/cmd.selfSpeedTest
        github.com/minio/minio/cmd/perf-tests.go:124 +0x8d6

@harshavardhana harshavardhana requested review from poornas and removed request for klauspost July 24, 2022 06:09
Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harshavardhana harshavardhana merged commit 42c18ba into minio:master Jul 24, 2022
@harshavardhana harshavardhana deleted the panic-send branch July 24, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants