gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

process priority sometimes fails

Open utam0k opened this issue 3 years ago • 0 comments

Bug description

The process priority plugin is sometimes only applied to some processes. In the following cases, the group of 504971 must have a nice value of -5.

$ ps axf -o pid,ni,cmd
...
 504739   0 /usr/local/bin/containerd-shim-runc-v2 -namespace k8s.io -id 5fa477a5741ed9e1f0a24f5e8322c6665731bbf72bd688272b97fde2182141f3 -address /run/containerd/containerd.sock
 504759   0  \_ /pause
 504811   0  \_ /.supervisor/workspacekit ring0
 504864   0      \_ /proc/self/exe ring1 --mapping-established
 504892 -10          \_ supervisor init
 504948 -10              \_ supervisor run
 504970   0                  \_ /bin/bash
 505934   0                  |   \_ go test ./...
 507868   0                  |       \_ /home/gitpod/go/pkg/tool/linux_amd64/link -o /tmp/go-build2190347413/b107/cgroups.test -importcfg /tmp/go-build2190347413/b107/importcfg.link -s -w -buildmode=exe -buildid=Cne5zAgKwTeQw5tPwGIe/Pjz7hu6jf2589CNGO-UL/sdMx9k7i2eBg5bMzvCR_/Cne5zAgKwTeQw5tPwGIe -e
 507917   0                  |       \_ /home/gitpod/go/pkg/tool/linux_amd64/vet -atomic -bool -buildtags -errorsas -ifaceassert -nilfunc -printf -stringintconv /tmp/go-build2190347413/b109/vet.cfg
 504971   0                  \_ sh /ide/bin/gitpod-code --install-builtin-extension gitpod.gitpod-theme --install-builtin-extension github.vscode-pull-request-github --port 23000 --host 0.0.0.0 --without-connection-token --server-data-dir /workspace/.vscode-remote --do-not-sync --start-server
 507103   0                      \_ /ide/node /ide/out/server-main.js --install-builtin-extension gitpod.gitpod-theme --install-builtin-extension github.vscode-pull-request-github --port 23000 --host 0.0.0.0 --without-connection-token --server-data-dir /workspace/.vscode-remote --do-not-sync --sta
 507171   0                          \_ /ide/node /ide/out/bootstrap-fork --type=ptyHost --logsPath /workspace/.vscode-remote/data/logs/20220809T063816
 507824   0                          \_ /ide/node /ide/out/bootstrap-fork --type=fileWatcher

Probably depends on the time of this sleep https://github.com/gitpod-io/gitpod/blob/44122f380ac86eb25af0ad4b5aec144e30e675f8/components/ws-daemon/pkg/cgroup/plugin_process_priority_v2.go#L59

Steps to reproduce

It should be easier to reproduce if the waiting time before setting the process priority is very short. https://github.com/gitpod-io/gitpod/blob/44122f380ac86eb25af0ad4b5aec144e30e675f8/components/ws-daemon/pkg/cgroup/plugin_process_priority_v2.go#L59

Workspace affected

No response

Expected behavior

In all cases, the nice value is set correctly.

Example repository

No response

Anything else?

No response

utam0k avatar Aug 09 '22 06:08 utam0k

In all cases, the nice value is set correctly.

That requires we run the plugin periodically.

aledbf avatar Aug 22 '22 15:08 aledbf

That requires we run the plugin periodically.

That's one way to do it 👍

utam0k avatar Aug 22 '22 23:08 utam0k