From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 687A41FF0BC for ; Mon, 16 Nov 2026 16:59:54 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3EEDC215AD; Mon, 16 Nov 2026 16:59:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=venkatamutyala.com; s=google; t=1794642945; x=1795247745; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ooA1ssdJAH5b7++dlrzkOG5k/UR97Xm81N2TCZNhhgk=; b=jIpFguyUgjW5ELcuMFP1xhNiWS9EwEGmwBDuB0UlIjYIinHbEJhH7wXN+LPfPqkEkl Ekv+8QEPx89NAlRCLTc1HO+2e6V7Al3h3Ri4NSnZrMweEbVrfwaIZZ+vRu1Peric8NVI XOk/0LUVv3Q5hnnUqHZFBN54wU3Eh7hbxh59M6CnSp51YdplhoHY22gRuFXBQvo15205 x2B7zxZjGSOJ5IppqN0lGOr/Nvxq+nd7Y4kCXExxvMCGruAH8XMLE+2MaNjiD1A4AHjd zCJHTUDPQzM7JJloHCh9slqHywmcJPOMgk6WwkSHwx7q08S9z/TYtRHnALUF7j5+4nq9 W8zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794642945; x=1795247745; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ooA1ssdJAH5b7++dlrzkOG5k/UR97Xm81N2TCZNhhgk=; b=ujzzs5E6H7RAhGfM/iykTwUuAMTnMGXmdmaXazSET86qXcgVTjefQShHQk3jCgNGYU Hyhat3MYGuRFYaAU4fief1/XPHvqh0K0milXshcc02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6G 3ShQxdWGK30Yxo1mTD5Tz5fuSt4ReHpRpQ+nhdsDOkVu7TxiijgxRXghRe9Z0eIp+5APmqOjCWo 7Zg/kEYSE= X-Received: by 2002:a05:651c:549:b0:3ac:dc93:c80a with SMTP id 38308e7fff4ca-3ae2b375138mr11901291fa.0.1794642945320; Fri, 13 Nov 2026 23:55:45 -0800 (PST) From: Venkat To: pve-devel@lists.proxmox.com Subject: [PATCH common] fix #8124: rest environment: retry reading worker UPID on EINTR Date: Sat, 14 Nov 2026 07:55:44 +0000 Message-ID: <20261114075544.3684889-1-venkata@venkatamutyala.com> X-Mailer: git-send-email 2.51.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: venkata@venkatamutyala.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: AOMJ4GCZ6OM65CZA7F6B4XVDT2AS7CEP X-Message-ID-Hash: AOMJ4GCZ6OM65CZA7F6B4XVDT2AS7CEP X-Mailman-Approved-At: Mon, 16 Nov 2026 16:59:48 +0100 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: fork_worker waits for the newly forked worker to report its UPID by reading from a pipe. The API daemons install a Perl SIGCHLD handler, and Perl installs such handlers without SA_RESTART. If another worker of the same process exits while the parent waits, the read fails with EINTR, the buffer stays empty and the task start fails with "got no worker upid - start worker failed", although the worker itself started fine and is then killed. This shows up when many tasks start and end on a node at the same time, e.g. when creating several VMs in parallel through the API. Retry the read on EINTR, like readline_nointr in PVE::Tools does. The other reads of the handshake are not affected: the worker resets SIGCHLD to default before reading the parent's OK, and the final read of the control pipe in sync (CLI) mode only happens once the worker has written its status or died. Signed-off-by: Venkat --- src/PVE/RESTEnvironment.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm index 7c75272..88da491 100644 --- a/src/PVE/RESTEnvironment.pm +++ b/src/PVE/RESTEnvironment.pm @@ -687,8 +687,11 @@ sub fork_worker { POSIX::close($csync[0]); my $readbuf = ''; - # sync with child (wait until child starts) - POSIX::read($psync[0], $readbuf, 4096); + # sync with child (wait until child starts), retry on EINTR (see bug #8124) + while (1) { + my $res = POSIX::read($psync[0], $readbuf, 4096); + last if defined($res) || ($! != EINTR); + } if (!$sync) { POSIX::close($psync[0]); -- 2.51.1