bug: fix possible race condition when re-allocating batch#8629
Conversation
Signed-off-by: Adam Jasinski <[email protected]>
fpetkovski
left a comment
There was a problem hiding this comment.
Yeah the gRPC framework owns the data once you call Send, and it's responsible for its lifetime.
|
While we are at it; wdyt of making batch size part of the client request?.that way it's forwards and backwards compatible |
Sorry, could you elaborate? It is part of [1] - thanos/pkg/store/storepb/rpc.proto Lines 115 to 117 in 49dde50 [2] - Lines 459 to 467 in 49dde50 |
Ah nice nevermind I brainfarted |
…8629) Signed-off-by: Adam Jasinski <[email protected]>
Modifying the batch while it is being sent may cause a race condition
From grpc-go [1]:
[1] - https://github.com/grpc/grpc-go/blob/629ef39c3da583f56463213975f191661ac40dd2/stream.go#L135-L136