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

Cherry-pick #17622 to 7.x: [libbeat] Clarify field name / remove redundant semaphore creation #17648

Merged
merged 1 commit into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
- `queue.Eventer` has been renamed to `queue.ACKListener` {pull}16691[16691]
- Require logger as first parameter for `outputs.elasticsearch.client#BulkReadItemStatus`. {pull}16761[16761]
- Extract Elasticsearch client logic from `outputs/elasticsearch` package into new `esclientleg` package. {pull}16150[16150]
- Rename `queue.BufferConfig.Events` to `queue.BufferConfig.MaxEvents`. {pull}17622[17622]

==== Bugfixes

Expand Down
6 changes: 1 addition & 5 deletions libbeat/publisher/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ func New(
return nil, err
}

if count := p.queue.BufferConfig().Events; count > 0 {
p.eventSema = newSema(count)
}

maxEvents := p.queue.BufferConfig().Events
maxEvents := p.queue.BufferConfig().MaxEvents
if maxEvents <= 0 {
// Maximum number of events until acker starts blocking.
// Only active if pipeline can drop events.
Expand Down
2 changes: 1 addition & 1 deletion libbeat/publisher/queue/memqueue/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (b *broker) Close() error {

func (b *broker) BufferConfig() queue.BufferConfig {
return queue.BufferConfig{
Events: b.bufSize,
MaxEvents: b.bufSize,
}
}

Expand Down
4 changes: 3 additions & 1 deletion libbeat/publisher/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ type Queue interface {
// but still dropping events, the pipeline can use the buffer information,
// to define an upper bound of events being active in the pipeline.
type BufferConfig struct {
Events int // can be <= 0, if queue can not determine limit
// MaxEvents is the maximum number of events the queue can hold at capacity.
// A value <= 0 means there is no fixed limit.
MaxEvents int
}

// ProducerConfig as used by the Pipeline to configure some custom callbacks
Expand Down
2 changes: 1 addition & 1 deletion libbeat/publisher/queue/spool/spool.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (s *diskSpool) Close() error {

// BufferConfig returns the queue initial buffer settings.
func (s *diskSpool) BufferConfig() queue.BufferConfig {
return queue.BufferConfig{Events: -1}
return queue.BufferConfig{MaxEvents: -1}
}

// Producer creates a new queue producer for publishing events.
Expand Down