all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [RFC container] fix: shutdown: if lxc-stop fails, wait for socket closing with timeout
Date: Wed, 25 Jan 2023 13:19:31 +0100	[thread overview]
Message-ID: <fadb0d22-51aa-d97b-86f6-ae6a658045e4@proxmox.com> (raw)
In-Reply-To: <20230125082504.otpcwjshk5qxezqt@casey.proxmox.com>

On 25/01/2023 09:25, Wolfgang Bumiller wrote:
> The general approach is fine, but `run_with_timeout` uses SIGALRM and
> messes with signal handlers which is rather inelegant for such a thing,
> we should limit its use to when we have no other option (mainly
> file-locking).
>
> For this case we can just use IO::Poll like:
>
>      my $poll = IO::Poll->new();
>      $poll->mask($sock => POLLIN | POLLHUP); # watch for input & EOF
>      $poll->poll($shutdown_timeout);
>
> If the socket was closed, then `$poll->mask($sock)` should contain the
> `POLLHUP` bits.

Thanks for the suggestion, looks much nicer! I'll send a new version of 
the patch.





  reply	other threads:[~2023-01-25 12:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 12:39 Friedrich Weber
2023-01-25  8:25 ` Wolfgang Bumiller
2023-01-25 12:19   ` Friedrich Weber [this message]
2023-02-17 13:59 ` [pve-devel] applied: " Wolfgang Bumiller

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=fadb0d22-51aa-d97b-86f6-ae6a658045e4@proxmox.com \
    --to=f.weber@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 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