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 v2 2/3] fix #7400: api: gracefully handle corrupted job statefiles
Date: Thu, 19 Mar 2026 12:23:14 +0100	[thread overview]
Message-ID: <6c3c411e-8dac-4ca5-ae62-daab7aed1f04@proxmox.com> (raw)
In-Reply-To: <20260319110318.70346-3-m.koeppl@proxmox.com>

one nit inline.

On 3/19/26 12:02 PM, Michael Köppl wrote:
> Previously, if a job statefile was empty or corrupted (e.g. due to an
> I/O error or an abrupt shutdown), the JobStatus::load method would
> return an error that would be propagated up, causing the endpoint to
> return an error to the user, meaning users would not see any of their
> jobs if a single job had a corrupted statefile.
> 
> Instead, handle the error explicitly, logging an error message and
> returning a default JobScheduleStatus such that jobs lists can still be
> fetched, displaying the affected job as configured but simply missing
> its last run status.
> 
> Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
> ---
>   src/server/jobstate.rs | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/src/server/jobstate.rs b/src/server/jobstate.rs
> index cfb0b8945..638beac3e 100644
> --- a/src/server/jobstate.rs
> +++ b/src/server/jobstate.rs
> @@ -305,8 +305,17 @@ pub fn compute_schedule_status(
>       jobname: &str,
>       schedule: Option<&str>,
>   ) -> Result<JobScheduleStatus, Error> {
> -    let job_state = JobState::load(jobtype, jobname)
> -        .map_err(|err| format_err!("could not open statefile for {}: {}", jobname, err))?;
> +    let job_state = match JobState::load(jobtype, jobname) {
> +        Ok(job_state) => job_state,
> +        Err(err) => {
> +            log::error!(
> +                "could not open statefile for {}: {} - falling back to default job schedule status",
> +                jobname,
> +                err
> +            );

nit: please inline `jobname` and `err` into the format string directly. 
While there are still a lot of per-existing occurrences without 
in-lining, for new code in-lining is preferred.




  reply	other threads:[~2026-03-19 11:23 UTC|newest]

Thread overview: 8+ 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 " 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-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 [this message]
2026-03-19 11:03 ` [PATCH proxmox-backup v2 3/3] 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=6c3c411e-8dac-4ca5-ae62-daab7aed1f04@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