Browse Source

we must only return io.EOF to progress to the next file in auto.Group

since we never write msg partially, if we've encountered io.EOF in the
middle of the msg, we must abort
pull/1607/head
Anton Kaliaev 6 years ago
parent
commit
f3f5c7f472
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 0 additions and 6 deletions
  1. +0
    -6
      consensus/wal.go

+ 0
- 6
consensus/wal.go View File

@ -273,9 +273,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
b = make([]byte, 4)
_, err = dec.rd.Read(b)
if err == io.EOF {
return nil, err
}
if err != nil {
return nil, fmt.Errorf("failed to read length: %v", err)
}
@ -287,9 +284,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
data := make([]byte, length)
_, err = dec.rd.Read(data)
if err == io.EOF {
return nil, err
}
if err != nil {
return nil, fmt.Errorf("failed to read data: %v", err)
}


Loading…
Cancel
Save