From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [PATCH pve-common] rest environment: start each worker task with a clean warning count
Date: Tue, 20 Oct 2026 09:38:43 +0200 [thread overview]
Message-ID: <e606f9ed-d7ab-4381-84fa-ac5cf6a61029@proxmox.com> (raw)
In-Reply-To: <20260904072535.501236-1-h.laimer@proxmox.com>
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 <h.laimer@proxmox.com>
> ---
> 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"; };
>
prev parent reply other threads:[~2026-10-20 7:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 7:25 [PATCH pve-common] rest environment: start each worker task with a clean warning count Hannes Laimer
2026-10-20 7:38 ` Hannes Laimer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e606f9ed-d7ab-4381-84fa-ac5cf6a61029@proxmox.com \
--to=h.laimer@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox