Skip to content

Commit

Permalink
[Backport 7.58.x] Revert Handle errors in python subprocess `cmd.Star…
Browse files Browse the repository at this point in the history
…t()` (#30286)

Co-authored-by: gh123man <brian.floersch@datadoghq.com>
  • Loading branch information
agent-platform-auto-pr[bot] and gh123man authored Oct 23, 2024
1 parent c84ce81 commit 734c28c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/collector/python/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func testGetSubprocessOutputUnknownBin(t *testing.T) {
assert.Equal(t, "", C.GoString(cStdout))
assert.Equal(t, "", C.GoString(cStderr))
assert.Equal(t, C.int(0), cRetCode)
assert.NotNil(t, exception)
assert.Nil(t, exception)
}

func testGetSubprocessOutputError(t *testing.T) {
Expand Down
6 changes: 1 addition & 5 deletions pkg/collector/python/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ func GetSubprocessOutput(argv **C.char, env **C.char, cStdout **C.char, cStderr
outputErr, _ = io.ReadAll(stderr)
}()

err = cmd.Start()
if err != nil {
*exception = TrackedCString(fmt.Sprintf("internal error starting subprocess: %v", err))
return
}
cmd.Start() //nolint:errcheck

// Wait for the pipes to be closed *before* waiting for the cmd to exit, as per os.exec docs
wg.Wait()
Expand Down

0 comments on commit 734c28c

Please sign in to comment.