public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: Dietmar Maurer <dietmar@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 4/5] backup: use flock on backup group to forbid multiple backups at once
Date: Thu, 30 Jul 2020 10:02:56 +0200	[thread overview]
Message-ID: <29878928-248b-afe7-dc49-c2d600bd03ba@proxmox.com> (raw)
In-Reply-To: <1460472930.74.1596094882668@webmail.proxmox.com>

On 7/30/20 9:41 AM, Dietmar Maurer wrote:
> 
>> On 07/30/2020 9:36 AM Stefan Reiter <s.reiter@proxmox.com> wrote:
>>
>>   
>> On 7/30/20 7:50 AM, Dietmar Maurer wrote:
>>>> +        // acquire in non-blocking mode, no point in waiting here since other
>>>> +        // backups could still take a very long time
>>>> +        tools::lock_file(&mut handle, true, Some(Duration::from_nanos(0)))
>>>> +            .map_err(|err| {
>>>> +                match err.downcast_ref::<nix::Error>() {
>>>> +                    Some(nix::Error::Sys(nix::errno::Errno::EAGAIN)) => {
>>>
>>> Honestly, I would remove this special case with downcast - the default error message is good enough. Isn't it?
>>>
>>
>> The original message ends in "EAGAIN - Try again", which to me sounded
>> like inviting the user to just run the command again, instead of telling
>> them there's a backup running.
> 
> The suggestion is too use: "unable to acquire lock on backup group {:?} - {}",
> 

Yes, and with that the error message reads:

"Error: unable to acquire lock on backup group "host/xyz" - EAGAIN: Try 
again"

...which I think might confuse some users.
>>
>>>> +                        return format_err!(
>>>> +                            "unable to acquire lock on backup group {:?} - another backup is already running",
>>>> +                            self.group_path(),
>>>> +                        );
>>>> +                    },
>>>> +                    _ => ()
>>>> +                }
>>>> +                format_err!(
>>>> +                    "unable to acquire lock on backup group {:?} - {}",
>>>> +                    self.group_path(),
>>>> +                    err,
>>>> +                )
>>>> +            })?;
>>>> +
>>>> +        Ok(handle)
>>>> +    }
>>>> +




  reply	other threads:[~2020-07-30  8:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 12:33 [pbs-devel] [PATCH 0/5] fix #2881: protect base snapshots and avoid races Stefan Reiter
2020-07-29 12:33 ` [pbs-devel] [PATCH proxmox-backup 1/5] fix typo: avgerage to average Stefan Reiter
2020-07-30  5:25   ` [pbs-devel] applied: " Dietmar Maurer
2020-07-29 12:33 ` [pbs-devel] [PATCH proxmox-backup 2/5] datastore: prevent deletion of snaps in use as "previous backup" Stefan Reiter
2020-07-30  6:37   ` [pbs-devel] applied: " Dietmar Maurer
2020-07-30  6:40   ` [pbs-devel] " Fabian Grünbichler
2020-07-29 12:33 ` [pbs-devel] [PATCH proxmox-backup 3/5] tools: add nonblocking mode to lock_file Stefan Reiter
2020-07-30  6:23   ` [pbs-devel] applied: " Dietmar Maurer
2020-07-29 12:33 ` [pbs-devel] [PATCH proxmox-backup 4/5] backup: use flock on backup group to forbid multiple backups at once Stefan Reiter
2020-07-30  5:50   ` Dietmar Maurer
2020-07-30  7:36     ` Stefan Reiter
2020-07-30  7:41       ` Dietmar Maurer
2020-07-30  8:02         ` Stefan Reiter [this message]
2020-07-30  6:38   ` [pbs-devel] applied: " Dietmar Maurer
2020-07-29 12:33 ` [pbs-devel] [PATCH proxmox-backup 5/5] backup: ensure base snapshots are still available after backup Stefan Reiter
2020-07-30  6:38   ` [pbs-devel] applied: " Dietmar Maurer

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=29878928-248b-afe7-dc49-c2d600bd03ba@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=dietmar@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