-
Notifications
You must be signed in to change notification settings - Fork 265
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
[WIP] Fix hiding of errors in SecureChannel.readChunk #551
base: main
Are you sure you want to change the base?
Conversation
Good catch. I would suggest to fix it slightly differently since if err == io.EOF || err == nil && len(b) == 0 {
return nil, io.EOF
} |
Hmm, on my local branch the |
Hmm, I think this is surfacing a different issue |
have the same issue when I'm applying that patch on v0.3.0 |
I can't see it. I'll push this to v0.3.2 since this needs more investigation. |
Sorry I totally overlooked the integration tests. The problem probably has to do with func (s *SecureChannel) dispatcher() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
defer func() {
close(s.disconnected)
}()
for {
select {
case <-s.closing:
return
default:
resp := s.receive(ctx) // this is now returning non-io.EOF errors...
if resp.Err != nil {
select {
case <-s.closing:
return
default:
select {
case s.errCh <- resp.Err:
default:
}
}
}
if resp.Err == io.EOF { // therefore this is NOT returning from the dispatcher loop
return
}
... |
Hmm, when I run the test in isolation then it works every time. But not when I run the entire suite. |
@Opsi can you rebase your branch and fix the integration tests? |
Rebasing is no problem, but I don't if I can fix the integration tests.
|
Related to #550
readChunk
ofsecure_channel.go
was hiding the errors ofConn.Receive
, because of a wrong comparison.len(b) == 0
returns true wheneverb=nil
.