Skip to content

Medium: Filesystem: faster stop procedure when large number of proces… #1042

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dmuhamedagic
Copy link
Contributor

…ses using the filesystem are found

@krig
Copy link
Contributor

krig commented Oct 24, 2017

Hm, why not do the mass-kill even with fewer processes? My guess is that it's to kill the processes in a predictable order. But if that is a real concern, it seems like it could be really difficult to debug problems caused by the switch to a different method at an arbitrary limit.

@dmuhamedagic
Copy link
Contributor Author

dmuhamedagic commented Oct 24, 2017 via email

@krig
Copy link
Contributor

krig commented Oct 24, 2017

If it's just for the logging, perhaps something like this would work?

ps -f $pids | tail -n +2 | while read line; do
  ocf_log info "sending signal $sig to: $line"
done

and then just killing them all in a single command all the time.

@dmuhamedagic
Copy link
Contributor Author

dmuhamedagic commented Oct 24, 2017 via email

@krig
Copy link
Contributor

krig commented Oct 24, 2017

Ah, I see.. yeah, that does make sense that it would be.

@dmuhamedagic
Copy link
Contributor Author

Did you manage to do some further testing? This PR starting to rot a bit 😉

@oalbrigt
Copy link
Contributor

oalbrigt commented Sep 11, 2023

Our QE suggests simply dropping the entire for-loop.

E.g.:

pidcnt=$(echo "$pids" | wc -w)
ocf_log info "sending signal $sig to $pidcnt processes"
if [ $pidcnt -le 10 ]; then
	ocf_log info $(echo "$pids" | xargs ps -f)
fi
echo "$pids" | xargs kill -s $sig

or

pidcnt=$(echo "$pids" | wc -w)
ocf_log info "sending signal $sig to $pidcnt processes:\n$(echo '$pids' | xargs ps -f)"
echo "$pids" | xargs kill -s $sig

@dmuhamedagic
Copy link
Contributor Author

The latter seems to be the best way forward. Thank you for your work and thanks to the QE for providing the code!

@oalbrigt
Copy link
Contributor

Sadly it doesnt seem to work with our improved stop-action logic:
#1878

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.

3 participants