Remove duplicate PidExists/FindProcess, use pipe-fittings instead#4952
Open
e-gineer wants to merge 1 commit intoturbot:developfrom
Open
Remove duplicate PidExists/FindProcess, use pipe-fittings instead#4952e-gineer wants to merge 1 commit intoturbot:developfrom
e-gineer wants to merge 1 commit intoturbot:developfrom
Conversation
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>
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/utils/pid_exists.gowhich duplicatedPidExistsandFindProcessfrompipe-fittings/v2/utils, removing the local copy that contains the same gopsutilint32overflow bug causing failures on systems with UIDs > 2^31stop_services.goto useputils.PidExists(pipe-fittings version, which returnsbool) instead of the localutils.PidExists(which returned(bool, error))utils.PidExistsfunc in service shutdown code instead of the steampipe version #4487 to consolidate onto the pipe-fittings versionFixes #4951
Closes #4487
Note
The underlying gopsutil upgrade (to fix the
int32overflow inFindProcess) 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 tidycompletes without errorsgo build ./...compiles successfullyTesting
This PR is a pure code deletion + import consolidation — it removes the local duplicate
pkg/utils/pid_exists.goand updates the one remaining caller to use the pipe-fittings version. Verified withgo 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