From 65d913dece027687053d6663df3cc8158024179e Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 11 Apr 2024 11:05:57 -0700 Subject: [PATCH 1/2] stats: mark InPayload.Data and OutPayload.Data for deletion --- stats/stats.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stats/stats.go b/stats/stats.go index 4ab70e2d462a..117dadcbafaa 100644 --- a/stats/stats.go +++ b/stats/stats.go @@ -76,6 +76,7 @@ type InPayload struct { // Payload is the payload with original type. Payload any // Data is the serialized message payload. + // Deprecated: Data will be removed in the next release. Data []byte // Length is the size of the uncompressed payload data. Does not include any @@ -146,6 +147,7 @@ type OutPayload struct { // Payload is the payload with original type. Payload any // Data is the serialized message payload. + // Deprecated: Data will be removed in the next release. Data []byte // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). From a2cb56751af8652b54903539b12d1012ef8ff089 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Thu, 11 Apr 2024 12:58:27 -0700 Subject: [PATCH 2/2] add clarifying comment on Payload --- stats/stats.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stats/stats.go b/stats/stats.go index 117dadcbafaa..fdb0bd65182c 100644 --- a/stats/stats.go +++ b/stats/stats.go @@ -73,7 +73,9 @@ func (*PickerUpdated) isRPCStats() {} type InPayload struct { // Client is true if this InPayload is from client side. Client bool - // Payload is the payload with original type. + // Payload is the payload with original type. This may be modified after + // the call to HandleRPC which provides the InPayload returns and must be + // copied if needed later. Payload any // Data is the serialized message payload. // Deprecated: Data will be removed in the next release. @@ -144,7 +146,9 @@ func (s *InTrailer) isRPCStats() {} type OutPayload struct { // Client is true if this OutPayload is from client side. Client bool - // Payload is the payload with original type. + // Payload is the payload with original type. This may be modified after + // the call to HandleRPC which provides the OutPayload returns and must be + // copied if needed later. Payload any // Data is the serialized message payload. // Deprecated: Data will be removed in the next release.