Skip to content

Remove duplicate PidExists/FindProcess, use pipe-fittings instead#4952

Open
e-gineer wants to merge 1 commit intoturbot:developfrom
e-gineer:fix/uid-int32-overflow-4951
Open

Remove duplicate PidExists/FindProcess, use pipe-fittings instead#4952
e-gineer wants to merge 1 commit intoturbot:developfrom
e-gineer:fix/uid-int32-overflow-4951

Conversation

@e-gineer
Copy link
Copy Markdown
Contributor

@e-gineer e-gineer commented Mar 13, 2026

Summary

  • Delete pkg/utils/pid_exists.go which duplicated PidExists and FindProcess from pipe-fittings/v2/utils, removing the local copy that contains the same gopsutil int32 overflow bug causing failures on systems with UIDs > 2^31
  • Update the sole caller in stop_services.go to use putils.PidExists (pipe-fittings version, which returns bool) instead of the local utils.PidExists (which returned (bool, error))
  • This also resolves the TODO from Use pipe-fittings utils.PidExists func in service shutdown code instead of the steampipe version #4487 to consolidate onto the pipe-fittings version

Fixes #4951
Closes #4487

Note

The underlying gopsutil upgrade (to fix the int32 overflow in FindProcess) is tracked in turbot/pipe-fittings#781. That PR needs to land first for the full fix on systems with UIDs > 2^31. This PR removes the duplicate code so there's only one place to fix.

Test plan

  • go mod tidy completes without errors
  • go build ./... compiles successfully
  • Verify service start/stop works correctly on a standard system
  • Verify on a system with UID > 2^31 (after pipe-fittings#781 lands)

Testing

This PR is a pure code deletion + import consolidation — it removes the local duplicate pkg/utils/pid_exists.go and updates the one remaining caller to use the pipe-fittings version. Verified with go build ./... — no functional change, just removing duplication.

The actual int32 overflow fix is in the gopsutil upgrade tracked in turbot/pipe-fittings#781 / turbot/pipe-fittings#782. Once pipe-fittings releases with the gopsutil upgrade, steampipe should update its pipe-fittings dependency to pick up the fix.

🤖 Generated with Claude Code

Remove the local pkg/utils/pid_exists.go which duplicated the
PidExists and FindProcess functions from pipe-fittings/v2/utils.
The local copy contained the same gopsutil int32 overflow bug that
causes all commands to fail on systems with UIDs > 2^31.

Update the sole remaining caller in stop_services.go to use the
pipe-fittings version (which returns bool instead of (bool, error)).

Fixes turbot#4951
Closes turbot#4487

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

2 participants