From 7fe0ba4aad4b7c2a66695dda014151eee0df5009 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Mon, 29 Jan 2024 13:32:47 -0800 Subject: [PATCH] Use buffered channel in watcher client --- NOTICE.txt | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- x-pack/auditbeat/internal/ebpf/watcher_linux.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index dd27366f4fd..9594ffd92d1 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -12257,11 +12257,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/elastic/ebpfevents -Version: v0.3.0 +Version: v0.3.1 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/elastic/ebpfevents@v0.3.0/LICENSE.txt: +Contents of probable licence file $GOMODCACHE/github.com/elastic/ebpfevents@v0.3.1/LICENSE.txt: The https://github.com/elastic/ebpfevents repository contains source code under various licenses: diff --git a/go.mod b/go.mod index f804b8a01ad..9c99c0ec736 100644 --- a/go.mod +++ b/go.mod @@ -200,7 +200,7 @@ require ( github.com/aws/smithy-go v1.13.5 github.com/awslabs/kinesis-aggregation/go/v2 v2.0.0-20220623125934-28468a6701b5 github.com/elastic/bayeux v1.0.5 - github.com/elastic/ebpfevents v0.3.0 + github.com/elastic/ebpfevents v0.3.1 github.com/elastic/elastic-agent-autodiscover v0.6.7 github.com/elastic/elastic-agent-libs v0.7.5 github.com/elastic/elastic-agent-shipper-client v0.5.1-0.20230228231646-f04347b666f3 diff --git a/go.sum b/go.sum index 828d5d11938..9651b9b0e5e 100644 --- a/go.sum +++ b/go.sum @@ -660,8 +660,8 @@ github.com/elastic/bayeux v1.0.5 h1:UceFq01ipmT3S8DzFK+uVAkbCdiPR0Bqei8qIGmUeY0= github.com/elastic/bayeux v1.0.5/go.mod h1:CSI4iP7qeo5MMlkznGvYKftp8M7qqP/3nzmVZoXHY68= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3 h1:lnDkqiRFKm0rxdljqrj3lotWinO9+jFmeDXIC4gvIQs= github.com/elastic/dhcp v0.0.0-20200227161230-57ec251c7eb3/go.mod h1:aPqzac6AYkipvp4hufTyMj5PDIphF3+At8zr7r51xjY= -github.com/elastic/ebpfevents v0.3.0 h1:tN2X+FNyV2o1x81tX1anAyVwXOTd1iRNxlkhf6zVY24= -github.com/elastic/ebpfevents v0.3.0/go.mod h1:o21z5xup/9dK8u0Hg9bZRflSqqj1Zu5h2dg2hSTcUPQ= +github.com/elastic/ebpfevents v0.3.1 h1:cUP3QXx6MhRGVXWZSgNalY8y5Vd1dgC56DMfeejnXFU= +github.com/elastic/ebpfevents v0.3.1/go.mod h1:o21z5xup/9dK8u0Hg9bZRflSqqj1Zu5h2dg2hSTcUPQ= github.com/elastic/elastic-agent-autodiscover v0.6.7 h1:+KVjltN0rPsBrU8b156gV4lOTBgG/vt0efFCFARrf3g= github.com/elastic/elastic-agent-autodiscover v0.6.7/go.mod h1:hFeFqneS2r4jD0/QzGkrNk0YVdN0JGh7lCWdsH7zcI4= github.com/elastic/elastic-agent-client/v7 v7.6.0 h1:FEn6FjzynW4TIQo5G096Tr7xYK/P5LY9cSS6wRbXZTc= diff --git a/x-pack/auditbeat/internal/ebpf/watcher_linux.go b/x-pack/auditbeat/internal/ebpf/watcher_linux.go index 1c972ce8b14..f751abe8019 100644 --- a/x-pack/auditbeat/internal/ebpf/watcher_linux.go +++ b/x-pack/auditbeat/internal/ebpf/watcher_linux.go @@ -72,7 +72,7 @@ func (w *watcher) Subscribe(name string, events EventMask) <-chan ebpfevents.Rec w.clients[name] = client{ name: name, mask: events, - records: make(chan ebpfevents.Record), + records: make(chan ebpfevents.Record, w.loader.BufferLen()), } return w.clients[name].records