This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Conversation
- detect when p4-fusion gets killed - report status resource usage in stdout and return code
it's getting complex enough that an anonymous subprocess is unwieldy.
and make the gitserver build scripts identical and able to detect if they are OSS or enterprise, because the actual build process is the same, except for some naming.
55 tasks
use a pipe to capture output from the p4-fusion binary so that when it exits with a non-zero exit code, its output can be searched for a handled signal. Also added support for including the signal name in the output, if it can be found.
When being killed by the OOM reaper, the p4-fusion-binary process goes into a zombie state for a while before exiting. The stats collected while in that zombie state are invalid. Add the process state to the `ps` output and collect stats only if it is still alive.
7 tasks
indradhanush
approved these changes
May 16, 2023
Contributor
indradhanush
left a comment
There was a problem hiding this comment.
Left some questions, nothing major to be blocking.
We should run a main-dry-run against this to make sure everything is in place before merging.
Co-authored-by: Indradhanush Gupta <indradhanush.gupta@gmail.com>
Co-authored-by: Indradhanush Gupta <indradhanush.gupta@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address #42385 and other issues that crop up by wrapping
p4-fusioncalls with a shell script that detects whenp4-fusionis killed, gathers resource usage stats about the killed process, outputs info about the death along with the resource usage stats, and exits with a non-zero return code, so that the error is picked up by the UI and shown in the repo list (see attached video)To reduce friction, the shell script is named
p4-fusionand the actualp4-fusionbinary executable is renamedp4-fusion-binary. If we want to use different names, we will also need to modify the gitserver code that runs thep4-fusioncommands.Test plan
Build a gitserver Docker image, run a
p4-fusioncommand in it, kill thep4-fusion-binaryprocess, see that the output ends with info about the killed process, and see that the return code is non-zero.Build a gitserver Docker image:
Start a gitserver instance:
Connect two terminals to it:
In one terminal, run this command (get the admin password from 1Password):
In the other terminal, use
pkill -9 p4-fusion-binarto end it. That's not a typo: Alpine's process table stores only the first 15 characters of the command. You could instead usepkill -9 -f p4-fusion-binary, but that matches against the entire command line so it's more dangerous.In the first terminal:
$?and hit Enter to see the return code of thep4-fusioncommand. It should be 137.Success!