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

close all maps when agent is terminating #196

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Sep 26, 2023

Description

we can have stale map when the agent pod has been terminated

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • [] Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Signed-off-by: msherif1234 <mmahmoud@redhat.com>
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (f87021a) 31.84% compared to head (0ffab93) 31.75%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
- Coverage   31.84%   31.75%   -0.10%     
==========================================
  Files          37       37              
  Lines        3278     3288      +10     
==========================================
  Hits         1044     1044              
- Misses       2175     2185      +10     
  Partials       59       59              
Flag Coverage Δ
unittests 31.75% <0.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pkg/ebpf/tracer.go 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if err := m.objects.FlowSequences.Close(); err != nil {
errs = append(errs, err)
}
if len(errs) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to keep the objects reference if there are errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case we wanted to retry but we are in SIGTERM handler at this point so not sure how much time we have, I feel this is the source of stale entries
as per the doc as it sounded like best effort and not guaranteed https://github.com/cilium/ebpf/blob/d2b69beb8d3b8648c0017e661a7385ae2107a5be/map.go#L1108

@jotak
Copy link
Member

jotak commented Sep 29, 2023

code lgtm

/lgtm
Is that something with a bug / reproducible steps for QE? If not, can you update the description template for no-qe ?

@msherif1234
Copy link
Contributor Author

code lgtm

/lgtm Is that something with a bug / reproducible steps for QE? If not, can you update the description template for no-qe ?

No bug for it I saw it while doing some tests and while checking the code notice a couple of maps not freed up when the prog is closed

@jpinsonneau
Copy link
Contributor

LGTM too, merging this as it's no qe task

@openshift-ci
Copy link

openshift-ci bot commented Oct 2, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit eafd494 into netobserv:main Oct 2, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants