Skip to content
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

fix(pubsub): mark ignore option default for publish flow control #5983

Merged
merged 2 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pubsub/flow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
type LimitExceededBehavior int

const (
// FlowControlBlock signals to wait until the request can be made without exceeding the limit.
FlowControlBlock LimitExceededBehavior = iota
// FlowControlIgnore disables flow control.
FlowControlIgnore
FlowControlIgnore LimitExceededBehavior = iota
// FlowControlBlock signals to wait until the request can be made without exceeding the limit.
FlowControlBlock
// FlowControlSignalError signals an error to the caller of acquire.
FlowControlSignalError
)
Expand All @@ -47,7 +47,7 @@ type FlowControlSettings struct {

// LimitExceededBehavior configures the behavior when trying to publish
// additional messages while the flow controller is full. The available options
// include Block (default), Ignore (disable), and SignalError (publish
// are Ignore (disable, default), Block, and SignalError (publish
// results will return an error).
LimitExceededBehavior LimitExceededBehavior
}
Expand Down
6 changes: 2 additions & 4 deletions pubsub/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type PublishSettings struct {
// If MaxOutstandingBytes is set, that value will override BufferedByteLimit.
//
// Defaults to DefaultPublishSettings.BufferedByteLimit.
// Deprecated: Set `topic.PublishSettings.FlowControlSettings.MaxOutstandingBytes` instead.
// Deprecated: Set `Topic.PublishSettings.FlowControlSettings.MaxOutstandingBytes` instead.
BufferedByteLimit int

// FlowControlSettings defines publisher flow control settings.
Expand Down Expand Up @@ -628,9 +628,7 @@ func (t *Topic) initBundler() {
t.scheduler.BundleByteThreshold = t.PublishSettings.ByteThreshold

fcs := DefaultPublishSettings.FlowControlSettings
if t.PublishSettings.FlowControlSettings.LimitExceededBehavior != FlowControlBlock {
fcs.LimitExceededBehavior = t.PublishSettings.FlowControlSettings.LimitExceededBehavior
}
fcs.LimitExceededBehavior = t.PublishSettings.FlowControlSettings.LimitExceededBehavior
if t.PublishSettings.FlowControlSettings.MaxOutstandingBytes > 0 {
b := t.PublishSettings.FlowControlSettings.MaxOutstandingBytes
fcs.MaxOutstandingBytes = b
Expand Down