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 7A3BC1FF0AA for ; Tue, 20 Oct 2026 09:38:51 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 70B9D2160E; Tue, 20 Oct 2026 09:38:48 +0200 (CEST) Message-ID: Date: Tue, 20 Oct 2026 09:38:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-common] rest environment: start each worker task with a clean warning count To: pve-devel@lists.proxmox.com References: <20260904072535.501236-1-h.laimer@proxmox.com> From: Hannes Laimer Content-Language: en-US In-Reply-To: <20260904072535.501236-1-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792481923223 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.474 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DXIQGPE637TRVGELFPHAA4BU6JSIGWWW X-Message-ID-Hash: DXIQGPE637TRVGELFPHAA4BU6JSIGWWW X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: gentle ping, still applies :) On 2026-09-04 09:25, Hannes Laimer wrote: > The count lives in the per-process environment and is only reported by > a forked task at its end. A warning logged while handling a plain API > request stays counted, so every task the process forks afterwards ends > with WARNINGS although nothing in its log warned. > > Signed-off-by: Hannes Laimer > --- > reproducer: > > run it against a running guest > ``` > curl -sk -H "$T" -X PUT https://localhost:8006/api2/json/nodes/$N/qemu/$V/config --data-urlencode "net9=model=e1000,bridge=vmbr0,mtu=1400" > ``` > potentially a few times with different nics, so every worker is getting > the warning. Then just open a console, and close it again. The warning > count is on the worker, so every task the worker spawns will inherit > this count. > > ``` > Sep 04 08:45:47 sdn1 pvedaemon[19533]: netdev net9: ignoring MTU '1400', not using VirtIO > ``` > is the warning the worker counted, and is in the syslog. > > src/PVE/RESTEnvironment.pm | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm > index 81d7e29..7c75272 100644 > --- a/src/PVE/RESTEnvironment.pm > +++ b/src/PVE/RESTEnvironment.pm > @@ -562,6 +562,9 @@ sub fork_worker { > > $0 = "task $upid"; > $WORKER_FLAG = 1; > + # the count is reported at the end of this task, warnings the parent logged while > + # handling requests before the fork are not part of it > + $self->{warning_count} = 0; > > $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { die "received interrupt\n"; }; >