Skip to content

Commit 627e365

Browse files
committed
Do not reuse remote write requests in case of error
1 parent 6dd44ee commit 627e365

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/distributor/distributor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,12 @@ func (d *Distributor) send(ctx context.Context, ingester ring.InstanceDesc, time
874874
req.Source = source
875875

876876
_, err = c.PushPreAlloc(ctx, req)
877-
cortexpb.ReuseWriteRequest(req)
877+
878+
// We should not reuse the req in case of errors:
879+
// See: https://github.com/grpc/grpc-go/issues/6355
880+
if err == nil {
881+
cortexpb.ReuseWriteRequest(req)
882+
}
878883

879884
if len(metadata) > 0 {
880885
d.ingesterAppends.WithLabelValues(ingester.Addr, typeMetadata).Inc()

0 commit comments

Comments
 (0)