From: "Daniel Kral" <d.kral@proxmox.com>
To: "Dominik Rusovac" <d.rusovac@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox] resource-scheduling: topsis: add context to 'unwraps'
Date: Thu, 26 Feb 2026 11:18:41 +0100 [thread overview]
Message-ID: <DGOTF4LFT9UI.36DU9ECTL5CGL@proxmox.com> (raw)
In-Reply-To: <DGOSCZVD6JNC.2WLLI4O3E1DL7@proxmox.com>
On Thu Feb 26, 2026 at 10:28 AM CET, Dominik Rusovac wrote:
> I agree, unwrapping the option is indeed questionable. Yet these unwraps
> seemed good enough and I didn't want to touch the error handling itself,
> as it would entail more changes. Atm, we have no designated Error types
> to map to and imo just bail!-ing on a Result in this place adds no
> reasonable value. Consistently propagating errors from start to end
> would be more appropriate, I suppose.
>
> For now, I just added some context as to what must have gone wrong in
> this very situation, because it changes just a tiny bit of code, while
> adding reasonable information.
>
> I could send a v2 that touches error handling in general, though.
Currently, the only user of score_alternatives(...) is
score_nodes_to_start_service(...), where it's enough that nodes is an
empty slice to cause a panic. This isn't a problem now because the
function is unlikely to be called as there's always at least one node
available.
If we're going to use these for the load balancer, it could be way
easier to run into this, e.g. there is only one service restricted to a
single node, i.e., no migration candidates. Of course we could catch
this early, but returning a generic Error here and then handling that in
score_alternatives(...) to return an empty vec would be an improvement.
Having error types would be plus here of course, but needs some
consideration that it doesn't break building packages that use this
crate.
prev parent reply other threads:[~2026-02-26 10:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 13:06 Dominik Rusovac
2026-02-25 15:08 ` Daniel Kral
2026-02-26 9:28 ` Dominik Rusovac
2026-02-26 10:18 ` Daniel Kral [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=DGOTF4LFT9UI.36DU9ECTL5CGL@proxmox.com \
--to=d.kral@proxmox.com \
--cc=d.rusovac@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