From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
"Christian Ebner" <c.ebner@proxmox.com>,
"Michael Köppl" <m.koeppl@proxmox.com>,
pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v2 1/3] api: move statefile loading into compute_schedule_status
Date: Mon, 23 Mar 2026 16:22:13 +0100 [thread overview]
Message-ID: <DHA9J54J7VN3.2QJPP4ILEEK3F@proxmox.com> (raw)
In-Reply-To: <1774270312.uf8ttrfndd.astroid@yuna.none>
On Mon Mar 23, 2026 at 1:55 PM CET, Fabian Grünbichler wrote:
[snip]
>>>> This alters behavior as now it is never tried to load the state file if
>>>> status_in_memory.upid is None, so there is no error logged.
>>>>
>>>> So this must be expanded by an else branch where the loading is
>>>> attempted also for that case and the potential error logged.
>>>
>>> Missed that while refactoring, sorry for the oversight. Also noticed
>>> that there is an additional change in behavior regarding the handling of
>>> any *other* error that might occur in compute_schedule_status because
>>> previously, we would use basically ignore any error and return the
>>> default status here, e.g. if the UPID could not be parsed for a started
>>> job. To match this behavior, I could just do
>>>
>>> let computed_schedule: JobScheduleStatus =
>>> compute_schedule_status("garbage_collection", &store, Some(upid))
>>> .unwrap_or_else(|_| JobScheduleStatus::default());
>>>
>>> But the question is if the behavior here *should* differ from all other
>>> endpoints if the UPID could not be parsed? Because everywhere else we'd
>>> still return an error in that case.
>>
>> True: this was introduced with commit fe1d34d2e ("api: garbage collect
>> job status") and then adapted with commit 3ae21d87c ("GC: flatten
>> existing status into job status"). So I guess this is related to the
>> mentioned renaming.
>>
>> Maybe Fabian can give us a clue?
>
> If there is a sensible way to handle compute_schedule_status failing
> (AFAICT, currently that only triggers if the UPID can't be parsed), we
> should do it consistently across the board - the same is true if that is
> not possible ;)
Thanks for your feedback and input!
So I would keep the behavior implemented in the v2 version of this patch
and return an error to the user if parsing the UPID fails, matching the
behavior of all other endpoints.
>
> maybe we should introduce another JobState variant that is not persisted
> ever, but used as a placeholder for partially-invalid entries? we
> already do quite a bit of mangling of other invalid data there anyway..
That's actually how I initially planned to implement it. I introduced an
`Unknown` JobState and returned that if parsing the statefile failed
(again, could also do this if parsing the UPID failed). Not quite sure
about the name, though. Open to suggestions.
next prev parent reply other threads:[~2026-03-23 15:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 11:03 [PATCH proxmox-backup v2 0/3] fix #7400: improve handling of corrupted job statefiles Michael Köppl
2026-03-19 11:03 ` [PATCH proxmox-backup v2 1/3] api: move statefile loading into compute_schedule_status Michael Köppl
2026-03-19 11:24 ` Christian Ebner
2026-03-19 14:47 ` Michael Köppl
2026-03-19 15:27 ` Christian Ebner
2026-03-23 12:55 ` Fabian Grünbichler
2026-03-23 15:22 ` Michael Köppl [this message]
2026-03-19 11:03 ` [PATCH proxmox-backup v2 2/3] fix #7400: api: gracefully handle corrupted job statefiles Michael Köppl
2026-03-19 11:23 ` Christian Ebner
2026-03-19 11:03 ` [PATCH proxmox-backup v2 3/3] fix #7400: proxy: self-heal " Michael Köppl
2026-03-25 16:07 ` [PATCH proxmox-backup v2 0/3] fix #7400: improve handling of " Michael Köppl
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=DHA9J54J7VN3.2QJPP4ILEEK3F@proxmox.com \
--to=m.koeppl@proxmox.com \
--cc=c.ebner@proxmox.com \
--cc=f.gruenbichler@proxmox.com \
--cc=pbs-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