public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: "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 09:05:11 +0100	[thread overview]
Message-ID: <57632a32-1565-486a-bc05-ccd426d070f5@proxmox.com> (raw)
In-Reply-To: <DH62YLMHZA5R.3F70OLJ4871SJ@proxmox.com>

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).

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?




  reply	other threads:[~2026-03-19  8:05 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 [this message]
2026-03-19 10:19       ` Michael Köppl
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=57632a32-1565-486a-bc05-ccd426d070f5@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=m.koeppl@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal