Skip to content

checksum error not propagate to upper function calls #275

@bbiao

Description

@bbiao

In the code ( as in

err = s.validateChecksum(s.chunk.Bytes())
)

		err = s.validateChecksum(s.chunk.Bytes())
		if err != nil {
			return 0, nil
		}

If the validateChecksum return an err, it will just return 0, nil.

And in the following code (

n, err := br.stream.Read(b)
)

		n, err := br.stream.Read(b)
		br.Offset += int64(n)
		if err != nil && err != io.EOF {
			br.stream = nil
			br.datanodes.recordFailure(err)
			if n > 0 {
				return n, nil
			}

			continue
		}

There is a chance for the br.stream.Read return n > 0 and err = errInvalidChecksum, so the whole call will return n, nil

Is these a feature or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions