all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common 1/2] run with timeout: only special-case timeout error in list-context
Date: Wed, 30 Aug 2023 15:07:51 +0200	[thread overview]
Message-ID: <20230830130752.85746-1-f.ebner@proxmox.com> (raw)

and not other errors too.

Fixes: a6aa0ae ("run with timeout: return if timeout happened in list context")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Tools.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 50240c8..724fb69 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -143,7 +143,8 @@ sub run_with_timeout {
     # this shouldn't happen anymore?
     die "unknown error" if $sigcount && !$err; # seems to happen sometimes
 
-    die $err if $err && !wantarray; # assume that user handles timeout err if called in list context
+    # assume that user handles timeout err if called in list context
+    die $err if $err && (!wantarray || !$got_timeout);
 
     return wantarray ? ($res, $got_timeout) : $res;
 }
-- 
2.39.2





             reply	other threads:[~2023-08-30 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 13:07 Fiona Ebner [this message]
2023-08-30 13:07 ` [pve-devel] [PATCH common 2/2] run fork with timeout: only special case timeout error in list context Fiona Ebner
2023-08-30 14:45 ` [pve-devel] applied-series: [PATCH common 1/2] run with timeout: only special-case timeout error in list-context Thomas Lamprecht

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=20230830130752.85746-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal