public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH common v2 0/2] cmd: run: do not leave the command behind on a caller's timeout
@ 2026-11-09  7:59 Kefu Chai
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Kefu Chai @ 2026-11-09  7:59 UTC (permalink / raw)
  To: pve-devel; +Cc: w.bumiller

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-09  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09  7:59 [PATCH common v2 0/2] cmd: run: do not leave the command behind on a caller's timeout Kefu Chai
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

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