Retries on xds:/// channels (or with RawMessageClientInterceptor) send empty 0-byte payload on retry
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
What version of gRPC-Java are you using?
Broken: 1.83.0/1.83.1
Working: 1.82.2
What is your environment?
Azul Zulu JDK 26
Summary
When an RPC is retried on an 'xds:///' channel (or any channel with raw 'InputStream' pass-through marshalling), retry attempts send an empty 0-byte payload (a 5-byte gRPC frame '00 00 00 00 00') rather than replying with the original request payload. If the backend server is configured to also accept an empty protobuf message (e.g. a batch request containing 0 items) and returns 'OK', this results in silent false positives, ie the replayed (now) empty message doesn't throw any error.
RetriableStream replays messages via 'method.streamRequest(message)'. When 'method' uses a raw 'InputStream' pass-through marshaller, the already consumed 'InputStream' is passed to subsequent retry attempts without being re-buffered. Starting on version 1.83.0, 'XdsNameResolver' introduced 'RawMessageClientInterceptor' on every 'xds:///' call. In turn, that rebuilds the method with a pass-through InputStream marshaller. As a result, all retried calls on 'xds:///' channels transmit empty request bodies.
The retry itself comes from Traffic Director over xDS.
What did you expect to see?
On retry, the client should replay the full original payload buffer
user-agent: grpc-java-netty/1.83.0
Attempt 1 (StreamId=3): sends 857 bytes -> server returns grpc-status: 13
Retry 1 (streamId=3 on second connection): sends 857 bytes -> server returns grpc-status: 13
Retry 2 (streamId=5): sends 857 bytes -> server returns grpc-status: 13
Retry 3 (streamId=5): sends 857 bytes -> server returns grpc-status: 13
Retry 4 (streamId=7): sends 857 bytes -> server returns grpc-status: 13
StatusRuntimeException(INTERNAL) -> MyServiceInternalException
What did you see instead?
user-agent: grpc-java-netty/1.83.0
Attempt 1 (StreamId=3): sends 857 bytes -> server returns grpc-status: 13
Retry (streamId=5): sends 5 bytes (0000000000 - empty body) -> server returns grpc-status: 0 (OK) with empty response
Steps to reproduce the bug
- Using grpc-java 1.83.0+, create an xds:// channel (or a channel with XdsNameResolver.RawMessageClientInterceptor) with RetryPolicy configured in serviceConfig
- Issue a unary or batch RPC (with a non-empty payload)
- Have the server return a retryable status (INTERNAL/UNAVAILABLE) on attempt 1
- Attempt 2 will transmit an empty 5-byte frame with 0 payload bytes.
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 42
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus grpc/grpc-java
-
docs enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
grpc/grpc-java#10824 · 8 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
question
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
grpc/grpc-java#13129 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
xds: duplicate endpoint addresses across localities are ACKed and can panic outlier detectionEvtl. vergeben @valeter hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 45/100
Maintainer antworten meist innerhalb von 1 Tag
-
binder: `ServerStream.close()` marks the stream closed before the suffix is sent, so a flow-control-deferred send failure leaks the callEvtl. vergeben @kkmurthyt21 hat das vor 13 Tagen übernommen. Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
grpc/grpc-java#13097 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
binder: RuntimeException during outbound serialization leaks the call and never notifies the peerEvtl. vergeben @mvanhorn hat das vor 18 Tagen übernommen. Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
grpc/grpc-java#13093 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
strimzi/strimzi-kafka-operator#13328 · 1 Kommentar · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
OpenLiberty/ci.maven#2137 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Payer adjustment can exceed the balance left after copay and deductible, so claim payments add up to more than the chargeEvtl. vergeben @DG47 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
synthetichealth/synthea#1772 ·
Maintainer antworten meist innerhalb von 13 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
geonetwork/core-geonetwork#9592 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NationalSecurityAgency/ghidra#10040 ·
Maintainer antworten meist innerhalb von 2 Tagen