Skip to content

streaming: should return cancel error instead of Internal error with unexpected EOF #8281

@fuweid

Description

@fuweid

What version of gRPC are you using?

v1.72.0

What version of Go are you using (go version)?

v1.24.2

What operating system (Linux, Windows, …) and version?

Linux

What did you do?

In the ETCD integration test, there is a case that verifies the client receives a context canceled error when reading data from a streaming RPC and the context is subsequently canceled. The steps would be like

# in etcd main branch
$ cd ./tests/integration/clientv3
$ go test -v ./ -count=10 --failfast -run TestMaintenanceSnapshotTimeout

What did you expect to see?

I should receice context canceled error

What did you see instead?

received rpc error: code = Internal desc = unexpected EOF

I can't reproduce this issue with v1.71.0 version. Right now, I found that

if err == io.EOF {
- the p.r.Read returns io.EOF and then convert it into unexpectedEOF.

REF: etcd-io/etcd#19833 (comment)

cc @ahrtr @dfawley

Metadata

Metadata

Assignees

Labels

Area: ClientIncludes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more.Type: Bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions