• Kubernetes Submit Queue's avatar
    Merge pull request #29685 from bboreham/kill-setpgid-3 · 6f7cc12c
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Fix killing child sudo process in e2e_node tests
    
    Fixes #29211; re-doing #29380 which was reverted due to cross-platform build failure #29669.
    
    The context is we are trying to kill a process started as `sudo kube-apiserver`, but `sudo` ignores signals from the same process group. Applying `Setpgid` means the `sudo kill` process won't be in the same process group, so will not fall foul of this nifty feature.
    
    ~~I also took the liberty of removing some code setting `Pdeathsig` because it claims to be doing something  in the same area, but actually it doesn't do that at all.  The setting is applied to the forked process, i.e. `sudo`, and it means the `sudo` will get killed if we (`e2e_node.test`) die.  This (a) isn't what the comment says and (b) doesn't help because sending SIGKILL to the sudo process leaves sudo's child alive.~~
    
    We do need to use the same 'hack' to access `Setpgid` as the `e2e_node.test` program gets built on Windows (although it doesn't run there).
    
    <!-- Reviewable:start -->
    ---
    This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29685)
    <!-- Reviewable:end -->
    6f7cc12c
Name
Last commit
Last update
..
environment Loading commit data...
jenkins Loading commit data...
runner Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
cgroup_manager_test.go Loading commit data...
container.go Loading commit data...
container_manager_test.go Loading commit data...
density_test.go Loading commit data...
disk_eviction_test.go Loading commit data...
doc.go Loading commit data...
e2e_build.go Loading commit data...
e2e_node_suite_test.go Loading commit data...
e2e_remote.go Loading commit data...
e2e_service.go Loading commit data...
image.go Loading commit data...
image_conformance_test.go Loading commit data...
image_list.go Loading commit data...
kubelet_test.go Loading commit data...
memory_eviction_test.go Loading commit data...
mirror_pod_test.go Loading commit data...
resource_controller.go Loading commit data...
resource_usage_test.go Loading commit data...
runtime_conformance_test.go Loading commit data...
util.go Loading commit data...