From 67facd9697e931e193f3cd8e188f1dd819ba31eb Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 5 Aug 2021 09:56:32 -0700 Subject: [PATCH] fix(bigquery/storage/managedwriter): fix flowcontroller double-release (#4555) 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. Towards: https://github.com/googleapis/google-cloud-go/issues/4366 --- 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 }