From: Kefu Chai <k.chai@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: w.bumiller@proxmox.com
Subject: [PATCH common v2 0/2] cmd: run: do not leave the command behind on a caller's timeout
Date: Mon, 9 Nov 2026 15:59:36 +0800 [thread overview]
Message-ID: <20261109075938.1737717-1-k.chai@proxmox.com> (raw)
Hi,
a colleague ran 'pvesm alloc' on an RBD pool whose placement groups
never became active: the storage lock gave up and got released, but
'rbd create' just kept running. Patch 2 kills and reaps the command
after run's eval if it is still around. Patch 1 stops run() from
cancelling the caller's alarm on its way out, which would let
'lvcreate' run without the lock's limit on shared LVM once 'vgs' ran
before it.
Changes since v1, from Wolfgang's review [1]:
- patch 1: disable the caller's alarm before installing our own ALRM
handler, so it cannot fire into the new handler right before our
timeout is armed, which would have been reported as run's timeout
- patch 1: run the flush of the last buffered stderr line in its own
eval, since the caller's alarm can interrupt it now; its error is
warned on a timeout and appended otherwise, with a new test
Patch 2 is unchanged. I replied to the review [1] why I kept it a
separate patch.
Link to v1: https://lore.proxmox.com/pve-devel/20261021110126.4024539-1-k.chai@proxmox.com/
[1] https://lore.proxmox.com/pve-devel/cgsng52kirt4qcaehzqlb75kqttxcgjirdgum6ndwp7ym6ag2d@p254xv6gnjv4/
Kefu Chai (2):
cmd: run: do not cancel the caller's alarm
cmd: run: kill the command when run dies
src/PVE/Cmd.pm | 90 ++++++++++++++++++++++++----------------------
test/cmd-test.pl | 85 ++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 132 insertions(+), 43 deletions(-)
--
2.47.3
next reply other threads:[~2026-11-09 7:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 7:59 Kefu Chai [this message]
2026-11-09 7:59 ` [PATCH common v2 1/2] cmd: run: do not cancel the caller's alarm Kefu Chai
2026-11-09 7:59 ` [PATCH common v2 2/2] cmd: run: kill the command when run dies Kefu Chai
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=20261109075938.1737717-1-k.chai@proxmox.com \
--to=k.chai@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=w.bumiller@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