You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Start a server (I tried with examples ufs.go)
2. Start client which reads a (big) file, like
file, err := c.FOpen(name, p.OREAD)
if err != nil {
return nil, os.NewError(err.String())
}
defer file.Close()
buf := make([]byte, 8192)
for {
fmt.Printf("reading chunk\n")
n, err := file.Read(buf)
if err != nil {
return nil, os.NewError(err.String())
}
if n == 0 {
break
}
dest.Write(buf[0:n])
}
3. Kill the server in the middle of the write
The reader will be stuck during read and never resume.
Original issue reported on code.google.com by mmikuli...@gmail.com on 31 May 2011 at 1:32
The text was updated successfully, but these errors were encountered:
After some debugging I found out that the file.Read call returns correcty an
EOF error, but my client doesn't return because it's blocked on "defer
file.Close()".
I believe it's a bug and that file.Close() should be able to complete also in
this circumstance.
Original comment by mmikuli...@gmail.com on 31 May 2011 at 2:21
So basically what happens is that after a connection is broken every next
attempt to send rpc messages will block.
This happens because the "Send" goroutine exits without closing his acceptor
channel:
func (clnt *Clnt) send() {
for {
select {
case <-clnt.done:
return
...
Attaching a patch.
Original comment by mmikuli...@gmail.com on 31 May 2011 at 3:07
Original issue reported on code.google.com by
mmikuli...@gmail.com
on 31 May 2011 at 1:32The text was updated successfully, but these errors were encountered: