From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Christian Ebner" <c.ebner@proxmox.com>,
"Michael Köppl" <m.koeppl@proxmox.com>,
pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v1 1/2] fix #7400: api: gracefully handle corrupted job statefiles
Date: Thu, 19 Mar 2026 11:19:20 +0100 [thread overview]
Message-ID: <DH6OL2FK3NWV.Q40Q03SMIV5U@proxmox.com> (raw)
In-Reply-To: <57632a32-1565-486a-bc05-ccd426d070f5@proxmox.com>
On Thu Mar 19, 2026 at 9:05 AM CET, Christian Ebner wrote:
> On 3/18/26 6:22 PM, Michael Köppl wrote:
>> On Tue Mar 17, 2026 at 5:07 PM CET, Michael Köppl wrote:
>>
>> [snip]
>>
>>> };
>>> use pbs_config::prune;
>>> use pbs_config::CachedUserInfo;
>>> @@ -73,10 +73,13 @@ pub fn list_prune_jobs(
>>> let mut list = Vec::new();
>>>
>>> for job in job_config_iter {
>>> - let last_state = JobState::load("prunejob", &job.id)
>>> - .map_err(|err| format_err!("could not open statefile for {}: {}", &job.id, err))?;
>>> -
>>> - let mut status = compute_schedule_status(&last_state, Some(&job.schedule))?;
>>> + let mut status = match JobState::load("prunejob", &job.id) {
>>> + Ok(last_state) => compute_schedule_status(&last_state, Some(&job.schedule))?,
>>> + Err(err) => {
>>> + log::error!("could not open statefile for {}: {}", &job.id, err);
>>
>> Since I'm currently preparing v2, would it make sense to instead make
>> this a warning? Not quite sure about it, but displaying an error to the
>> user and then just continuing (and having self-healing behavior) seems a
>> bit odd to me.
>
> IMO it makes sense as an error. There was an error reading the file
> after all. And you might not always be able to self-heal. E.g. what if
> you cannot re-write the state file (although this should be logged as well).
Ack, I see your point. Thanks for the feedback, I'll leave it as an
error.
>
> Further, I do not expect these to show up frequently and the error
> message could be adapted to include the default being used as fallback?
Yeah, something like "could not open statefile for {}: {} - falling back
to default job schedule status". I'll adapt it and send the v2.
next prev parent reply other threads:[~2026-03-19 10:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 16:07 [PATCH proxmox-backup v1 0/2] fix #7400: improve handling of " Michael Köppl
2026-03-17 16:07 ` [PATCH proxmox-backup v1 1/2] fix #7400: api: gracefully handle " Michael Köppl
2026-03-18 16:15 ` Christian Ebner
2026-03-18 17:04 ` Michael Köppl
2026-03-18 17:22 ` Michael Köppl
2026-03-19 8:05 ` Christian Ebner
2026-03-19 10:19 ` Michael Köppl [this message]
2026-03-17 16:07 ` [PATCH proxmox-backup v1 2/2] fix #7400: proxy: self-heal " 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=DH6OL2FK3NWV.Q40Q03SMIV5U@proxmox.com \
--to=m.koeppl@proxmox.com \
--cc=c.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.