smux icon indicating copy to clipboard operation
smux copied to clipboard

Corrupt stream after expired WriteDeadline

Open ltucker opened this issue 5 years ago • 0 comments

If you set a write deadline and it expires, Write may return an incorrect number of bytes written (It always returns 0 although some may have actually succeeded anyway since the write goes on a request queue for the sendLoop). This effectively corrupts the stream from the client perspective.

Here is an echo test that demonstrates: https://gist.github.com/ltucker/e63cdd323ed8480d606d809467f45f93 And a branch with the test here: https://github.com/ltucker/smux/tree/bigwritedeadline

This may be expected behavior? (eg tls.Conn is considered corrupt after a write deadline expires) -- it's not documented as such, so I expected this to work.

ltucker avatar Jun 26 '19 15:06 ltucker