From 1494aee5d3c805cd96a70ed8ed3a336cea6c9fd7 Mon Sep 17 00:00:00 2001 From: Seth Hollyman Date: Wed, 4 Aug 2021 23:39:52 +0000 Subject: [PATCH] fix(bigquery/storage/managedwriter): fix flowcontroller double-release Stress testing caught this one: responsibility for releasing flow controlled resources is in markDone of pending write, and the reference in the recvProcessor was over-freeing resources. --- bigquery/storage/managedwriter/managed_stream.go | 1 - 1 file changed, 1 deletion(-) diff --git a/bigquery/storage/managedwriter/managed_stream.go b/bigquery/storage/managedwriter/managed_stream.go index f66e58efe4c..e29d54395c4 100644 --- a/bigquery/storage/managedwriter/managed_stream.go +++ b/bigquery/storage/managedwriter/managed_stream.go @@ -358,7 +358,6 @@ func recvProcessor(ctx context.Context, arc storagepb.BigQueryWrite_AppendRowsCl recordStat(ctx, AppendResponses, 1) if status := resp.GetError(); status != nil { - fc.release(nextWrite.reqSize) nextWrite.markDone(NoStreamOffset, grpcstatus.ErrorProto(status), fc) continue }