Skip to content

Commit

Permalink
[automation] update libbeat and beats packaging (#7602)
Browse files Browse the repository at this point in the history
* Update to elastic/beats@6e046b747c6b

* Move Manager.Start() and Manager.Stop() in the beat execution.

This move the Manager.Start and Stop into the Beats' run method, this
move ensure that the system is configured and ready to receive events.

Having the Manager started and stopped at the Libbeat level was causing
inconsistency when configuring the Beats by the Elastic Agent.
The problem would lead to the following behavior:

- Zombie Beats with only outputs configured
- Beats without any inputs configured
- Beats with some of the input configured.

The problem was often cause by restarting the agent and having the
machine under a significant load.

See: elastic/beats#30694 for details

* Update mock Manager implementation

Co-authored-by: apmmachine <infra-root-apmmachine@elastic.co>
Co-authored-by: Pier-Hugues Pellerin <phpellerin@gmail.com>
Co-authored-by: Andrew Wilkins <axw@elastic.co>
  • Loading branch information
4 people authored Mar 23, 2022
1 parent b7fdbb5 commit 4396872
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
12 changes: 6 additions & 6 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/beats/v7
Version: v7.17.2-0.20220318064113-3a004fba71f0
Version: v7.17.2-0.20220321192621-6e046b747c6b
Licence type (autodetected): Elastic
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.17.2-0.20220318064113-3a004fba71f0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.17.2-0.20220321192621-6e046b747c6b/LICENSE.txt:

Source code in this repository is variously licensed under the Apache License
Version 2.0, an Apache compatible license, or the Elastic License. Outside of
Expand Down Expand Up @@ -19873,11 +19873,11 @@ THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/crypto
Version: v0.0.0-20220315160706-3147a52a75dd
Version: v0.0.0-20220321153916-2c7772ba3064
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.0.0-20220315160706-3147a52a75dd/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.0.0-20220321153916-2c7772ba3064/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -20058,11 +20058,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : google.golang.org/genproto
Version: v0.0.0-20220317150908-0efb43f6373e
Version: v0.0.0-20220322021311-435b647f9ef2
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0-20220317150908-0efb43f6373e/LICENSE:
Contents of probable licence file $GOMODCACHE/google.golang.org/genproto@v0.0.0-20220322021311-435b647f9ef2/LICENSE:


Apache License
Expand Down
8 changes: 8 additions & 0 deletions beater/beater.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ func (bt *beater) run(ctx context.Context, cancelContext context.CancelFunc, b *
ctx, reload.ReloadableFunc(reloader.reloadOutput),
)
})

// Start the manager after all the hooks are initialized
// and defined this ensure reloading consistency..
if err := b.Manager.Start(); err != nil {
return err
}
defer b.Manager.Stop()

} else {
// Management disabled, use statically defined config.
reloader.namespace = "default"
Expand Down
7 changes: 7 additions & 0 deletions beater/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1000,3 +1000,10 @@ type mockManager struct {
func (m *mockManager) Enabled() bool {
return m.enabled
}

func (m *mockManager) Start() error {
return nil
}

func (m *mockManager) Stop() {
}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d // indirect
github.com/dustin/go-humanize v1.0.0
github.com/elastic/apm-server/approvaltest v0.0.0-00010101000000-000000000000
github.com/elastic/beats/v7 v7.17.2-0.20220318064113-3a004fba71f0
github.com/elastic/beats/v7 v7.17.2-0.20220321192621-6e046b747c6b
github.com/elastic/ecs v1.12.0
github.com/elastic/elastic-agent-client/v7 v7.0.0-20210922110810-e6f1f402a9ed // indirect
github.com/elastic/gmux v0.2.0
Expand Down Expand Up @@ -62,14 +62,14 @@ require (
go.uber.org/atomic v1.9.0
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
golang.org/x/tools v0.1.10
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e // indirect
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2 // indirect
google.golang.org/grpc v1.45.0
gotest.tools/gotestsum v1.7.0
howett.net/plist v1.0.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/eclipse/paho.mqtt.golang v1.2.1-0.20200121105743-0d940dd29fd2 h1:DW6WrARxK5J+o8uAKCiACi5wy9EK1UzrsCpGBPsKHAA=
github.com/elastic/beats/v7 v7.17.2-0.20220318064113-3a004fba71f0 h1:H/Y7kvC4d5QYypN9VMp3gIw4lTnveM0ga3fYr8Jd3XE=
github.com/elastic/beats/v7 v7.17.2-0.20220318064113-3a004fba71f0/go.mod h1:nFsbsraCRGlck/aOwtfEJFKEyVBiDqxGvZ3ZES6sMn4=
github.com/elastic/beats/v7 v7.17.2-0.20220321192621-6e046b747c6b h1:QuCqYWv6+gbIMK/uggNHcYjbKQ2OETb2bZccettTTAk=
github.com/elastic/beats/v7 v7.17.2-0.20220321192621-6e046b747c6b/go.mod h1:nFsbsraCRGlck/aOwtfEJFKEyVBiDqxGvZ3ZES6sMn4=
github.com/elastic/ecs v1.12.0 h1:u6WZ2AWtxv5vHvTQ4EuVZdWZ51mKHQ2UIltRePcta5U=
github.com/elastic/ecs v1.12.0/go.mod h1:pgiLbQsijLOJvFR8OTILLu0Ni/R/foUNg0L+T6mU9b4=
github.com/elastic/elastic-agent-client/v7 v7.0.0-20210922110810-e6f1f402a9ed h1:H5si6Yglir/pIyYQur/Es/ByTkQAoNDqidI8gBB2IGs=
Expand Down Expand Up @@ -1498,8 +1498,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 h1:S25/rfnfsMVgORT4/J61MJ7rdyseOZOyvLIrZEZ7s6s=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1839,8 +1839,8 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e h1:fNKDNuUyC4WH+inqDMpfXDdfvwfYILbsX+oskGZ8hxg=
google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2 h1:3n0D2NdPGm0g0wrVJzXJWW5CBOoqgGBkDX9cRMJHZAY=
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
Expand Down

0 comments on commit 4396872

Please sign in to comment.