]> git.proxmox.com Git - pve-common.git/commit
fix #4615: REST environment: improve AnyEvent detectíon in child cleanup
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 27 Mar 2023 08:26:32 +0000 (10:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 27 Mar 2023 08:35:53 +0000 (10:35 +0200)
commita0bae1b6e5f18c512bb36c49e543f47940f1c2bb
treefe6ad7f71a0d57464d92dd6025c2f369571f7802
parent8328617d06d60160660393faea10569d06ae0c66
fix #4615: REST environment: improve AnyEvent detectíon in child cleanup

I assumed that the 'priv' and 'pub' RESTEnvironment types always
contained an AnyEvent eventloop, but this is actually not the case in
pvestatd and pvescheduler.

But it depended on the used model that AnyEvent used (and auto
detected) if this wrong assumption worked or not. With the
AnyEvent::Impl::Perl there weren't any problems and it seemingly
worked by accident, but when using AnyEvent::Impl::EV (which is
autodetected and used when libev-perl is installed) it interfered
with our SIG_CHLD handlers and only ever called them once. (Not clear
why this happens, maybe because AnyEvent is not setup correctly).

This patch uses $AnyEvent::MODEL as a detection instead since this is
`undef` until the first AnyEvent watcher is created, which should be
only the case where we really use AnyEvent, such as pveproxy and
pvedaemon.

Fixes: 6870afa ("RESTEnvironment: better SIGCHLD handling in AnyEvent event loop")
Link: https://lists.proxmox.com/pipermail/pve-devel/2023-March/056057.html
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/RESTEnvironment.pm