cleanup(sinsp): remove threadinfo dependency on thread_manager/usergroup_manager#2689
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnosek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2689 +/- ##
==========================================
- Coverage 76.92% 76.90% -0.02%
==========================================
Files 294 296 +2
Lines 30856 30875 +19
Branches 4683 4693 +10
==========================================
+ Hits 23736 23745 +9
- Misses 7120 7130 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Great! Thank you. I'll review it after 0.22.0 is released 😄 |
|
/hold until I figure out what's going on with the tests |
mstemm
left a comment
There was a problem hiding this comment.
Overall looks good. Just a question/comment about removing the setter methods.
05dcb6f to
da1dce2
Compare
|
Note: this now includes the other PR (#2694) but if we decide against merging that, I can take it out. I'd just rather resolve the merge conflicts once. |
53d19e0 to
45bba36
Compare
45bba36 to
9caa558
Compare
irozzo-1A
left a comment
There was a problem hiding this comment.
LGTM overall, just a few comments. I addressed some of those myself as we discussed offline.
b0e00fa to
e492c73
Compare
e492c73 to
2120c62
Compare
|
LGTM label has been added. DetailsGit tree hash: 5a18d8ec828ca270176699532f704062dc0874db |
|
/hold |
An individual thread should not know or care about the existence of a thread manager. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This code is used only by filterchecks and does not belong in the threadinfo itself. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
A threadinfo should not need to know its position in the hierarchy Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This is effectively a helper for internal thread_manager code Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
A threadinfo should not need to know its place in the hierarchy Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This class holds all data related to accessing plugin-defined fields and tables from libsinsp itself. None of this is the responsibility of e.g. the thread_manager or individual threadinfos, but it has to live somewhere. Rather than put it in the `sinsp` kitchen sink, move it all to a separate class. Note: at this point we still keep the accessors available through thread_manager/threadinfo, they will be cleaned up later. Co-Authored-By: Iacopo Rozzo <iacopo@sysdig.com> Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Instead, use plugin_tables to access the plugin-defined field Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Instead, the threadinfo is now responsible only for storing uids and gids. User/group name handling is now done only in filterchecks. Co-Authored-By: Iacopo Rozzo <iacopo@sysdig.com> Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Also, finally remove all traces of usergroup_manager and thread_manager from threadinfo Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
2120c62 to
2e3421e
Compare
|
/unhold |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR removes references to thread_manager/usergroup_manager from threadinfo. The references are cyclic dependencies involving code that's not even in sinsp any more (the container plugin), and make reasoning about the code harder than needed.
Summary of changes in threadinfo methods:
get_container_id,get_container_user,get_container_ip-- replaced with a method onsinsp->m_plugin_tablesget_user,get_group,get_loginuserand correspondingset_*methods -- removed (inlined into filterchecks)get_parent_thread-- removed (inlined into callers)get_ancestor_process,traverse_parent_state,get_ancestor_field_as_string-- moved tosinsp_thread_managerThe following user-facing changes require some action to be taken:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: