31z4 / zookeeper-docker

Docker image packaging for Apache Zookeeper
MIT License
285 stars 243 forks source link

Use dumb-init #137

Closed tsuna closed 1 year ago

tsuna commented 2 years ago

Currently Zookeeper runs as PID 1. This is a problem because it does not reap child processes. When run under Kubernetes, if a command is used to check the liveness of Zookeeper such as

  test "$(echo ruok | nc -q 3 127.0.0.1 2181)" = imok

then these shell processes will linger in the container as zombies and pile up over time. Depending on the frequency of the checks and how long Zookeeper is up, this could lead to an excessive number of processes and eventually cause an outage, or cause some other weird behaviors on the host, such as ps taking 20min to print anything.

31z4 commented 1 year ago

Sorry, I don't feel like adding dump-init to the image. For the following reasons:

I'd suggest trying http probe to 127.0.0.1:8080/commands/ruok/commands/ruok instead.