From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pbs-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 943071FF2CA
	for <inbox@lore.proxmox.com>; Tue, 23 Jul 2024 14:51:17 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 54001373E;
	Tue, 23 Jul 2024 14:51:52 +0200 (CEST)
Date: Tue, 23 Jul 2024 14:51:48 +0200 (CEST)
From: Christian Ebner <c.ebner@proxmox.com>
To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com>, 
 Dominik Csapak <d.csapak@proxmox.com>
Message-ID: <1188716440.3583.1721739108877@webmail.proxmox.com>
In-Reply-To: <a1151392-963d-4dfe-b184-b94e656cd5da@proxmox.com>
References: <20240723100448.1571064-1-d.csapak@proxmox.com>
 <a1151392-963d-4dfe-b184-b94e656cd5da@proxmox.com>
MIME-Version: 1.0
X-Priority: 3
Importance: Normal
X-Mailer: Open-Xchange Mailer v7.10.6-Rev67
X-Originating-Client: open-xchange-appsuite
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.021 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
Subject: Re: [pbs-devel] [PATCH proxmox-backup] fix #5622: backup client:
 properly handle rate/burst parameters
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox Backup Server development discussion
 <pbs-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pbs-devel-bounces@lists.proxmox.com
Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com>


> On 23.07.2024 14:48 CEST Christian Ebner <c.ebner@proxmox.com> wrote:
> 
>  
> On 7/23/24 12:04, Dominik Csapak wrote:
> > the rate and burst parameters are integers, so the mapping from value
> > with `.as_str()` will always return `None` effectively never
> > applying any rate limit at all.
> > 
> > To fix it, just map from u64 to HumanByte.
> > 
> > Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> > ---
> > 
> > Alternatively, we could introduce a new string schema to parse into
> > HumanByte, if that's preferred. (Did not do it that way, because this
> > fix was way faster for me and is also OK in my opinion).
> 
> There is already a string schema definition for rate limits [0], might 
> be worth to reuse that and parse into `HumanByte` as you suggested?
> 
> [0] 
> https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=pbs-api-types/src/traffic_control.rs;h=fb264531e291329fbc0a0a7f54da158ba50e8bb1;hb=HEAD#l21

Ah no, this is the already used IntegerSchema, never mind.


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel