From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup v2] daemon: add hack for sd_notify
Date: Wed, 11 Nov 2020 10:14:37 +0100 [thread overview]
Message-ID: <2907b557-dbeb-fd7d-dc12-9e01b9939f24@proxmox.com> (raw)
In-Reply-To: <20201111082751.7358-1-d.csapak@proxmox.com>
On 11.11.20 09:27, Dominik Csapak wrote:
> sd_notify is not synchronous, iow. it only waits until the message
> reaches the queue not until it is processed by systemd
>
> when the process that sent such a message exits before systemd could
> process it, it cannot be associated to the correct pid
>
> so in case of reloading, we send a message with 'MAINPID=<newpid>'
> to signal that it will change. if now the old process exits before
> systemd knows this, it will not accept the 'READY=1' message from the
> child, since it rejects the MAINPID change
>
> since there is no (AFAICS) library interface to check the unit status,
> we use 'systemctl is-active <SERVICE_NAME>' to check the state until
> it is not 'reloading' anymore.
>
> on newer systemd versions, there is 'sd_notify_barrier' which would
> allow us to wait for systemd to have all messages from the current
> pid to be processed before acknowledging to the child, but on buster
> the systemd version is to old...
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from v1:
> * only check the state in the parent pid, do not send ready
> in the child in a loop
> * changed the comment to include "FIXME"
> src/bin/proxmox-backup-api.rs | 1 +
> src/bin/proxmox-backup-proxy.rs | 1 +
> src/tools/daemon.rs | 26 ++++++++++++++++++++++++++
> 3 files changed, 28 insertions(+)
>
>
applied, thanks! With the followups we spoke off-list.
prev parent reply other threads:[~2020-11-11 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 8:27 [pbs-devel] " Dominik Csapak
2020-11-11 9:14 ` Thomas Lamprecht [this message]
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=2907b557-dbeb-fd7d-dc12-9e01b9939f24@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@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