[PR #6691] [CLOSED] [client] Update gopsutil to v4 #26684

Open
opened 2026-08-05 07:07:41 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6691
Author: @mlsmaycon
Created: 7/7/2026
Status: Closed

Base: mainHead: update-gopsutil-v4


📝 Commits (3)

  • 8114c94 [client] Update gopsutil to v4
  • aeae853 [client] Bump gopsutil library to v4
  • cfa37ce [client] Drop gopsutil v3 dependency

📊 Changes

4 files changed (+3 additions, -21 deletions)

View changed files

📝 client/system/process.go (+1 -1)
📝 client/system/process_test.go (+1 -1)
📝 go.mod (+1 -3)
📝 go.sum (+0 -16)

📄 Description

Describe your changes

gopsutil v3 can be much slower to retrieve processes on macOS: without cgo (our release builds) it spawns lsof per PID, blowing the 15s posture-check gathering budget.

--- scan A: gopsutil v3, CGO_ENABLED=0 ---
v3 run 1: 626 processes, 421 paths resolved, target running=true, took 15.673s

--- scan B: gopsutil v4, CGO_ENABLED=0 ---
v4 run 1: 623 processes, 610 paths resolved, target running=true, took 6ms

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • Chores
    • Updated a system process dependency to a newer major version.
    • Aligned related test and module references with the updated dependency.
  • Bug Fixes
    • Maintained existing process detection and cancellation behavior while improving compatibility with current library versions.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6691 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `update-gopsutil-v4` --- ### 📝 Commits (3) - [`8114c94`](https://github.com/netbirdio/netbird/commit/8114c94dbed7509f0370705cce21f0cb3a7fa9fa) [client] Update gopsutil to v4 - [`aeae853`](https://github.com/netbirdio/netbird/commit/aeae85367799ffeeb7f718bd8a1b32c4e219de8b) [client] Bump gopsutil library to v4 - [`cfa37ce`](https://github.com/netbirdio/netbird/commit/cfa37cedb29779a358733b6cf612fe92a4e8c5d6) [client] Drop gopsutil v3 dependency ### 📊 Changes **4 files changed** (+3 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `client/system/process.go` (+1 -1) 📝 `client/system/process_test.go` (+1 -1) 📝 `go.mod` (+1 -3) 📝 `go.sum` (+0 -16) </details> ### 📄 Description ## Describe your changes gopsutil v3 can be much slower to retrieve processes on macOS: without cgo (our release builds) it spawns `lsof` per PID, blowing the 15s posture-check gathering budget. ```shell --- scan A: gopsutil v3, CGO_ENABLED=0 --- v3 run 1: 626 processes, 421 paths resolved, target running=true, took 15.673s --- scan B: gopsutil v4, CGO_ENABLED=0 --- v4 run 1: 623 processes, 610 paths resolved, target running=true, took 6ms ``` ## Issue ticket number and link ## Stack ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [x] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from <https://github.com/netbirdio/docs> here: <https://github.com/netbirdio/docs/pull/>\_\_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated a system process dependency to a newer major version. * Aligned related test and module references with the updated dependency. * **Bug Fixes** * Maintained existing process detection and cancellation behavior while improving compatibility with current library versions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:07:41 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#26684