Skip to content

Commit c00ceb7

Browse files
committed
polish: trim comments
1 parent 6b59284 commit c00ceb7

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/envd/internal/port/forward.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (f *Forwarder) startPortForwarding(ctx context.Context, p *PortToForward) {
143143

144144
cgroupFD, ok := f.cgroupManager.GetFileDescriptor(cgroups.ProcessTypeSocat)
145145

146-
// socat intentionally inherits envd's SCHED_FIFO + Nice=-20 (infra-critical).
146+
// socat keeps envd's SCHED_FIFO + Nice=-20 by design.
147147
cmd.SysProcAttr = &syscall.SysProcAttr{
148148
Setpgid: true,
149149
}

packages/envd/internal/services/process/handler/handler.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ func New(
9696
// User command string for logging (without the internal wrapper details).
9797
userCmd := strings.Join(append([]string{req.GetProcess().GetCmd()}, req.GetProcess().GetArgs()...), " ")
9898

99-
// Reset everything we inherit from envd so the child runs at user
100-
// priority: write oom_score_adj, then chrt SCHED_FIFO->SCHED_OTHER
101-
// (needs CAP_SYS_NICE supplied via AmbientCaps below), setpriv to drop
102-
// that cap, and finally nice for SCHED_OTHER weight.
99+
// Reset oom_score_adj, drop SCHED_FIFO via chrt, drop the SYS_NICE
100+
// ambient cap, then apply nice.
103101
niceDelta := defaultNice - currentNice()
104102
wrapperScript := fmt.Sprintf(
105103
`echo %d > /proc/$$/oom_score_adj && exec /usr/bin/chrt --other 0 /usr/bin/setpriv --ambient-caps -all -- /usr/bin/nice -n %d "${@}"`,

0 commit comments

Comments
 (0)