[dancer-users] How can a fork+system() Dancer app not create zombie processes?

Andrew Beverley andy at andybev.com
Mon Apr 3 09:15:37 BST 2017


On Mon, 3 Apr 2017 11:01:23 +0300 Shlomi Fish wrote:
> When running a simple and reduced Dancer 1 application which forks
> and runs perldoc -f system , I am getting many zombie processes after
> making requests.

Forking a web app is not as simple as it first seems. You need to take
an approach like the following (hopefully the comments will explain
without me regurgitating here, but feel free to ask for clarification):

https://github.com/ctrlo/GADS/blob/cb8c9478dee8eac1f40a44486634173bed8d666d/lib/GADS/Record.pm#L1068

The key point being that you need to fork both a child and a
grand-child in order to correctly reap all the forked processes.

Andy


More information about the dancer-users mailing list