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

transport: WrapConn goroutine leak #289

Open
Kulezi opened this issue Sep 15, 2022 · 0 comments · May be fixed by #295
Open

transport: WrapConn goroutine leak #289

Kulezi opened this issue Sep 15, 2022 · 0 comments · May be fixed by #295
Labels
bug Something isn't working transport

Comments

@Kulezi
Copy link
Contributor

Kulezi commented Sep 15, 2022

If c.init() fails, the connection will never be closed, leading to leaked routines running in both connReader and connWriter loops.

go c.w.loop(ctx)
go c.r.loop()
if err := c.init(ctx); err != nil {
return c, err
}
return c, nil

@Kulezi Kulezi added bug Something isn't working transport labels Sep 15, 2022
Kulezi added a commit that referenced this issue Sep 23, 2022
WrapConn didn't close connReader and connWriter loops, leaving this
responsibility to its callers, potentially leading to goroutine leaks,
this is mitigated by closing those loops and never returning a non-nil
Conn pointer when WrapConn fails.

Fixes #289
@Kulezi Kulezi linked a pull request Sep 23, 2022 that will close this issue
Kulezi added a commit that referenced this issue Sep 23, 2022
WrapConn didn't close connReader and connWriter loops, leaving this
responsibility to its callers, potentially leading to goroutine leaks,
this is mitigated by closing those loops and never returning a non-nil
Conn pointer when WrapConn fails.

Fixes #289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working transport
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant