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

panic: close of closed channel #160

Closed
zhongdonglin opened this issue Aug 2, 2021 · 3 comments
Closed

panic: close of closed channel #160

zhongdonglin opened this issue Aug 2, 2021 · 3 comments

Comments

@zhongdonglin
Copy link

This error occurs when I use mirrorPool.Because func (mr *masterReader) Read(p []byte) (n int, err error) repeats the Clone method twice.
I have made some changes to this for reference only:

func (mr *masterReader) Read(p []byte) (n int, err error) {
        buff := bytes.NewBuffer(nil)
        tee := io.TeeReader(mr.r, buff)
        n, err = tee.Read(p)

        if n != 0 {
                mr.buffChan <- buff.Bytes()
        } else {
                close(mr.buffChan)
        }

        // if err == io.EOF {
                // close(mr.buffChan)
        // }

        return n, err
}
@benja-wu benja-wu added the bug Something isn't working label Aug 2, 2021
@benja-wu benja-wu self-assigned this Aug 2, 2021
@benja-wu benja-wu added this to To do in Easegress Project via automation Aug 2, 2021
@benja-wu
Copy link
Contributor

benja-wu commented Aug 2, 2021

hi @zhongdonglin, thanks for reporting.
Can u share the panic stack and how to reproduce this panic? It's better to provide more details such as reproducing steps, Easegress YAML, and so on for problem/bug reporting. :-)

@zhao-kun
Copy link
Collaborator

zhao-kun commented Aug 3, 2021

@zhongdonglin you paste a piece of code that is changed by you, it can't help us diagnose the issue. Could you provide us the stack trace information of panic produced by the original code? Other background included(but not limited to) YAML spec etc. It will be better to help us solve the issue.

@zhao-kun zhao-kun added need more information and removed bug Something isn't working labels Aug 3, 2021
@benja-wu
Copy link
Contributor

benja-wu commented Aug 9, 2021

Closing, not enough information, please reopen if the needed information is provided.

@benja-wu benja-wu closed this as completed Aug 9, 2021
Easegress Project automation moved this from To do to Done Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants