Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor UID/GID cache updates in apps plugin aggregation logic#21864

Open
stelfrag wants to merge 1 commit intonetdata:masterfrom
stelfrag:fix_apps_plugin_part1
Open

Refactor UID/GID cache updates in apps plugin aggregation logic#21864
stelfrag wants to merge 1 commit intonetdata:masterfrom
stelfrag:fix_apps_plugin_part1

Conversation

@stelfrag
Copy link
Collaborator

@stelfrag stelfrag commented Mar 2, 2026

Summary
  • Relocate update_cached_host_users() and update_cached_host_groups() calls outside per-PID loops to optimize and simplify code structure.
  • Remove redundant updates within conditional blocks.

Summary by cubic

Refactored apps plugin aggregation to refresh UID/GID caches once per cycle instead of per process, removing redundant updates and reducing overhead. Simplifies control flow by moving cache updates before the PID loop.

  • Refactors
    • Call update_cached_host_users() and update_cached_host_groups() once before iterating PIDs (guarded by PROCESSES_HAVE_UID/GID).
    • Removed duplicate updates inside UID/GID branches.
    • No change to target selection or aggregation behavior.

Written for commit e05beaa. Summary will update on new commits.

- Relocate `update_cached_host_users()` and `update_cached_host_groups()` calls outside per-PID loops to optimize and simplify code structure.
- Remove redundant updates within conditional blocks.
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/apps labels Mar 2, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@stelfrag stelfrag marked this pull request as ready for review March 2, 2026 22:09
@stelfrag stelfrag requested a review from thiagoftsm as a code owner March 2, 2026 22:09
Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

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

Apps is working as expected after few hours. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection collectors/apps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants