Endless nix-daemon forks when running in kubernetes pod

I’m having a strange trouble while trying to run nix-daemon inside a kubernetes pod. Whenever another pod mounts the socket (in the same node) and makes a simple call (example nix-shell -p nmap), the daemon starts forking forever until it goes OOM.
The nix-daemon container starts printing logs like crazy. They all look like this:

accepted connection from pid 96631, user root (trusted)

It seems each log generates a new nix-daemon process that gets stall. It never ends and finally fills all the RAM.

What can be happening here? I’m using docker.io/nixos/nix:2.9.2 image. Thanks!

That log line means something connected to the nix daemon. Usually nix-shell should do this exactly once.

I noticed that in my laptop. However, in this context the line is printed in loop.

Hosted by Flying Circus.