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

When MaxStreamWindowSize is larger than initialStreamWindow, should lead to short read #63

Open
wllenyj opened this issue Jun 27, 2018 · 1 comment

Comments

@wllenyj
Copy link

wllenyj commented Jun 27, 2018

OpenStream call sendWindowUpdate, then sendWindowUpdate will sync window from client to server.
incrSendWindow and wirte will happen race. if incrSendWindow first run it is ok, else will lead sendWindow is not the same value to recvWindow, will out of sync.

// session_test.go
func TestSendData_Large(t *testing.T) {
    cfg := testConf()
    cfg.MaxStreamWindowSize = 4 * 1024 
    // ...
}
// const.go
const (
    // initialStreamWindow is the initial stream window size
    initialStreamWindow uint32 = 1 * 1024
)
=== RUN   TestSendData_Large
--- FAIL: TestSendData_Large (5.00s)
        session_test.go:415: short read: 1024
        session_test.go:441: err: stream reset
panic: timeout [recovered]
        panic: timeout
@wllenyj
Copy link
Author

wllenyj commented Jun 27, 2018

if MaxStreamWindowSize is not used for like this issue, please close.

@wllenyj wllenyj changed the title When MaxStreamWindowSize is larger than initialStreamWindow, will lead to short read When MaxStreamWindowSize is larger than initialStreamWindow, should lead to short read Jul 26, 2018
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

1 participant