Skip to content

Commit 6886445

Browse files
authored
bug(remote_write): Fix compression buffer pooling (#1889)
The compressed buffer is released before the request is made, which leads to corrupted remote-write payloads being sent to the target. Signed-off-by: Filip Petkovski <[email protected]>
1 parent 3d13af1 commit 6886445

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exp/api/remote/remote_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (r *API) Write(ctx context.Context, msgType WriteMessageType, msg any) (_ W
242242
return WriteResponseStats{}, fmt.Errorf("compressing %w", err)
243243
}
244244
r.bufPool.Put(buf)
245-
r.bufPool.Put(comprBuf)
245+
defer r.bufPool.Put(comprBuf)
246246

247247
// Since we retry writes we need to track the total amount of accepted data
248248
// across the various attempts.

0 commit comments

Comments
 (0)