Skip to content

Stop restarting processes if they exit more than 10 times in a minute - #831

Closed
Blue (OneBlue) wants to merge 1 commit into
mainfrom
throttle-crashes
Closed

Blue (OneBlue) wants to merge 1 commit into
mainfrom
throttle-crashes

Conversation

@OneBlue

Copy link
Copy Markdown
Collaborator

This change adds logic to wslgd::ProcessMonitor::Run to keep track of how often processes exit and stops restarting processes that exit more than 10 times in 60 seconds.

Tested by running pkill weston 10 times in the system distro, stderr.txt shows:

<4>WSLGd: /usr/bin/sh -c /usr/bin/weston --backend=rdp-backend.so --modules=wslgd-notify.so --xwayland --log=/mnt/wslg/weston.log --socket=wayland-0 --shell=rdprail-shell.so --logger-scopes=log,rdp-backend,rdprail-shell exited more than 10 times in 60 seconds, not starting it again

This change should help mitigate microsoft/WSL#6982 , since we've seen situations where wslg processes would crash and be restarted in a loop (although I don't think 100% of the high cpu usage issues are caused by wslg, I think some are)

@hideyukn88

Copy link
Copy Markdown
Contributor

Blue (@OneBlue), do we see any case of repeated crash of weston (or any process launched by WSLGd) on reasonable recent version? As you might be aware of the internal email thread the high CPU usage on arm64 is now understood, but if there is any instance of such repeated process crash, we should reach out to collect core dumps to fix the root case, rather throttling down to hide the issue?

@hideyukn88

Copy link
Copy Markdown
Contributor

abandon this PR and recreated as #1082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants