labring / sealos

Sealos is a production-ready Kubernetes distribution that provides a one-stop solution for both public and private cloud. https://sealos.io
https://cloud.sealos.io
Apache License 2.0
13.3k stars 2.02k forks source link

BUG: template frontend leaves zombie `git` processes #4796

Closed dinoallo closed 1 week ago

dinoallo commented 1 week ago

Sealos Version

v5.0

How to reproduce the bug?

Install Sealos with the template frontend enabled

What is the expected behavior?

No zombies

What do you see instead?

Find out one of the pids of the zombie processes:

# ps aux | grep Z
1001     63841  0.0  0.0      0     0 ?        Z    Jun21   0:00 [git] <defunct>
1001     64043  0.0  0.0      0     0 ?        Z    Jun20   0:00 [git] <defunct>
1001     64183  0.0  0.0      0     0 ?        Z    Jun22   0:00 [git] <defunct>
1001     64495  0.0  0.0      0     0 ?        Z    Jun20   0:00 [git] <defunct>
1001     64661  0.0  0.0      0     0 ?        Z    Jun21   0:00 [git] <defunct>

Find out which container holds this pid:

# pstree -s -p 64661
systemd(1)───containerd-shim(43915)───node(46306)───git(64661)
# pstree 46306
node─┬─108*[git]
     └─14*[{node}]
# crictl ps -q | xargs crictl inspect --output go-template --template '{{.info.pid}}, {{.status.metadata.name}}' | grep 46306
46306, template-frontend

Operating environment

No response

Additional information

These lines might be problematic:

https://github.com/labring/sealos/blob/78cefc7715b6c0952f079cc6bbc1bd32e96adbcb/frontend/providers/template/src/pages/api/updateRepo.ts#L83-L87

zjy365 commented 1 week ago

We have fixed the issue in this pull request: #4799. Please update to the latest version and verify.