Skip to content

feat: implement agent process management #9461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make fmt
  • Loading branch information
sreya committed Sep 8, 2023
commit 2fe9c70d9c2296b871f879f48e464fd06c88cce5
6 changes: 3 additions & 3 deletions agent/agentproc/agentproctest/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ func GenerateProcess(t *testing.T, fs afero.Fs, dir string, muts ...func(*agentp

process.Dir = fmt.Sprintf("%s/%d", dir, process.PID)

err = fs.MkdirAll(process.Dir, 0555)
err = fs.MkdirAll(process.Dir, 0o555)
require.NoError(t, err)

err = afero.WriteFile(fs, fmt.Sprintf("%s/cmdline", process.Dir), []byte(process.CmdLine), 0444)
err = afero.WriteFile(fs, fmt.Sprintf("%s/cmdline", process.Dir), []byte(process.CmdLine), 0o444)
require.NoError(t, err)

err = afero.WriteFile(fs, fmt.Sprintf("%s/oom_score_adj", process.Dir), []byte("0"), 0444)
err = afero.WriteFile(fs, fmt.Sprintf("%s/oom_score_adj", process.Dir), []byte("0"), 0o444)
require.NoError(t, err)

return process
Expand Down
2 changes: 1 addition & 1 deletion agent/agentproc/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (p *Process) SetOOMAdj(score int) error {
err := afero.WriteFile(p.FS,
path,
[]byte(strconv.Itoa(score)),
0644,
0o644,
)
if err != nil {
return xerrors.Errorf("write %q: %w", path, err)
Expand Down