Catalyst::Restarter::Forking: clear watcher in child process
authorAaron Crane <arc@cpan.org>
Thu, 12 Jan 2017 09:45:30 +0000 (09:45 +0000)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Sat, 14 Oct 2017 23:12:27 +0000 (01:12 +0200)
commit835133d258cdf1ff5c7f46a3c37230657231e552
treed15234d58bf3989467ee0e2fed70f7158292bd8f
parent962244bd8fadb79a0cb9134d7036ed17c819a723
Catalyst::Restarter::Forking: clear watcher in child process

This allows any resources held by the watcher to be released in the child
process, where they won't be needed.

This is particularly important in kqueue-based watcher implementations.
The way kqueue works requires an open file descriptor for each file and
directory watched. In the case of modules being loaded from a local::lib,
this can easily amount to many thousands of file descriptors. This is not
only wasteful, but it also prevents select(2) from being called on any
file descriptor subsequently opened: you're likely to get EINVAL because the
descriptor exceeds FD_SETSIZE.
Changes
lib/Catalyst/Restarter.pm
lib/Catalyst/Restarter/Forking.pm