-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(bigquery/storage/managedwriter): wire in flow controller #4501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bigquery/storage/managedwriter): wire in flow controller #4501
Conversation
This adds a flow controller to the managed stream, guarding AppendRows. This change puts the release responsibility for the flow controller in the markDone() method of the pendingWrite. Flow controller code is already well tested via unit tests, so this doesn't add any additional tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if err := ms.fc.acquire(ctx, pw.reqSize); err != nil { | ||
// in this case, we didn't acquire, so don't pass the flow controller reference to avoid a release. | ||
pw.markDone(NoStreamOffset, err, nil) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shollyman Is there a missing return here? We've observed the following panic, which seems like it could be related to markDone resetting pw.request above before the append call proceeds below.
runtime error: invalid memory address or nil pointer dereference
at cloud.google.com/go/bigquery/storage/managedwriter.(*ManagedStream).append ( /go/src/github.com/ScriptRock/webscan-golang/vendor/cloud.google.com/go/bigquery/storage/managedwriter/managed_stream.go:284 )
at cloud.google.com/go/bigquery/storage/managedwriter.(*ManagedStream).AppendRows ( /go/src/github.com/ScriptRock/webscan-golang/vendor/cloud.google.com/go/bigquery/storage/managedwriter/managed_stream.go:363 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #5428 to follow up on this. Sheer luck I saw this comment, but looks likely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This adds a flow controller to the managed stream, guarding AppendRows.
This change puts the release responsibility for the flow controller in
the markDone() method of the pendingWrite. Flow controller code is
already well tested via unit tests, so this doesn't add any additional
tests.
Towards: #4366