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

stream.Close() stuck if buffer is full #37

Closed
MingchenZhang opened this issue Oct 19, 2018 · 3 comments
Closed

stream.Close() stuck if buffer is full #37

MingchenZhang opened this issue Oct 19, 2018 · 3 comments

Comments

@MingchenZhang
Copy link

MingchenZhang commented Oct 19, 2018

If the underlying buffer of net.Conn is full (any may be full forever), it would block the write call to smux stream. If a Close() is called on the stream, it would attempt to write cmdFIN, but this write blocks as well.
The keepalive() goroutine should come and save the day, but it is also stuck at sending cmdNOP. This leaves no one watching on tickerTimeout, and the Close() function of the underlying net.Conn wouldn't be called to resolve the deadlock.
My program sometime gets into a stuck and i believe this is the reason. Could someone take a look? Or I made a mistake in understanding the code?

@sintanial
Copy link
Contributor

Any update ?
I think, to solve this problem, need to add deadline when write data to connect in this line

smux/session.go

Line 317 in b993df6

n, err := s.conn.Write(buf[:headerSize+len(request.frame.data)])

@jannson
Copy link
Contributor

jannson commented Mar 9, 2019

The keepalive is timeout when all writing operations blocked, and then the session closed!

@xtaci
Copy link
Owner

xtaci commented Apr 19, 2019

solved?

@xtaci xtaci closed this as completed Apr 24, 2019
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

No branches or pull requests

4 participants