Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netobserv-ebpf-agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
netobserv-ebpf-agent
Commits
eafd4942
Unverified
Commit
eafd4942
authored
1 year ago
by
Mohamed S. Mahmoud
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
close all maps when agent is terminating (#196)
Signed-off-by:
msherif1234
<
mmahmoud@redhat.com
>
parent
6feace71
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/ebpf/tracer.go
+17
-5
17 additions, 5 deletions
pkg/ebpf/tracer.go
with
17 additions
and
5 deletions
pkg/ebpf/tracer.go
+
17
−
5
View file @
eafd4942
...
...
@@ -288,19 +288,23 @@ func (m *FlowFetcher) registerIngress(iface ifaces.Interface, ipvlan netlink.Lin
}
// Close the eBPF fetcher from the system.
// We don't need a
n
"Close(iface)" method because the filters and qdiscs
// We don't need a "Close(iface)" method because the filters and qdiscs
// are automatically removed when the interface is down
// nolint:cyclop
func
(
m
*
FlowFetcher
)
Close
()
error
{
log
.
Debug
(
"unregistering eBPF objects"
)
var
errs
[]
error
if
m
.
pktDropsTracePoint
!=
nil
{
m
.
pktDropsTracePoint
.
Close
()
if
err
:=
m
.
pktDropsTracePoint
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
}
if
m
.
dnsTrackerTracePoint
!=
nil
{
m
.
dnsTrackerTracePoint
.
Close
()
if
err
:=
m
.
dnsTrackerTracePoint
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
}
// m.ringbufReader.Read is a blocking operation, so we need to close the ring buffer
// from another goroutine to avoid the system not being able to exit if there
...
...
@@ -323,7 +327,15 @@ func (m *FlowFetcher) Close() error {
if
err
:=
m
.
objects
.
DirectFlows
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
m
.
objects
=
nil
if
err
:=
m
.
objects
.
DnsFlows
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
if
err
:=
m
.
objects
.
FlowSequences
.
Close
();
err
!=
nil
{
errs
=
append
(
errs
,
err
)
}
if
len
(
errs
)
==
0
{
m
.
objects
=
nil
}
}
for
iface
,
ef
:=
range
m
.
egressFilters
{
log
:=
log
.
WithField
(
"interface"
,
iface
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment