#5833 Fix Deadlock when using shardByURL of VMAgent (#5834)

This commit is contained in:
Anton L 2024-02-22 12:54:53 +03:00 committed by GitHub
parent 0c7eda7c88
commit 8b7ff0f66e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -536,13 +536,13 @@ func tryPushBlockToRemoteStorages(rwctxs []*remoteWriteCtx, tssBlock []prompbmar
// Push sharded data to remote storages in parallel in order to reduce
// the time needed for sending the data to multiple remote storage systems.
var wg sync.WaitGroup
wg.Add(len(rwctxs))
var anyPushFailed uint64
for i, rwctx := range rwctxs {
tssShard := tssByURL[i]
if len(tssShard) == 0 {
continue
}
wg.Add(1)
go func(rwctx *remoteWriteCtx, tss []prompbmarshal.TimeSeries) {
defer wg.Done()
if !rwctx.TryPush(tss) {