From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7FC1691CDF for ; Wed, 31 Jan 2024 12:55:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5F2B93A05E for ; Wed, 31 Jan 2024 12:55:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 31 Jan 2024 12:55:24 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E201249372 for ; Wed, 31 Jan 2024 12:55:23 +0100 (CET) Message-ID: <74530bb6-6ccc-4b6e-ae3e-c1411fd7f4d7@proxmox.com> Date: Wed, 31 Jan 2024 12:55:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pve-devel@lists.proxmox.com References: <20240118111147.131727-1-f.weber@proxmox.com> <4f959cf9-5068-4c14-aaf6-885f9cbf982a@proxmox.com> From: Friedrich Weber In-Reply-To: <4f959cf9-5068-4c14-aaf6-885f9cbf982a@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.089 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [PATCH v2 storage] lvm: improve warning in case vgs output contains unexpected lines X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2024 11:55:25 -0000 On 23/01/2024 11:01, Friedrich Weber wrote: > On 19/01/2024 12:31, Fiona Ebner wrote: >> Am 19.01.24 um 11:59 schrieb Fiona Ebner: [...] >>> Please use log_warn() from PVE::RESTEnvironment for new warnings, so >>> they also show up in task logs. >> >> Sorry, I mean "show up more visibly", because they count towards the >> warning count shown in the task result. > > Thanks, wasn't aware of this benefit of `log_warn`. > > Will send a v3 with the two changes. After changing `warn` to `log_warn` I noticed that pvestatd does not write the warning to the syslog every 10s anymore. Turns out `warn` triggers a custom __WARN__ handler we install for our daemons which also writes to syslog (e.g. pvestatd [1]). But `log_warn` only writes to stderr [2], thus the `log_warn` warning is not written to the syslog. Briefly discussed with Fiona off-list, she suggested to try replacing `print` in `log_warn` with `warn` [2]. But with this, all `log_warn` warnings also appear in the syslog (e.g. the "no efidisk configured" warning [3]), which I think would be too spammy. I'd suggest I use `log_warn` in this patch and keep `log_warn` as it is (printing only to stderr) for now. The downside is that pvestatd will not log the `vgs` warning to the syslog anymore (but doing that every 10 seconds could also be considered spammy anyway). The upside is that e.g. a qmstart task log has the warning in its task log and shows "Warnings: 1" in the GUI, which might be better for visibility than a syslog message anyway. What do you think? [1] https://git.proxmox.com/?p=pve-manager.git;a=blob;f=bin/pvestatd;h=5cd727e9;hb=d90563e4#l15 [2] https://git.proxmox.com/?p=pve-common.git;a=blob;f=src/PVE/RESTEnvironment.pm;h=191c6eb;hb=c6ec71d84#l735 [3] https://git.proxmox.com/?p=qemu-server.git;a=blob;f=PVE/QemuServer.pm;h=b45507aa;hb=eb86f776#l3492