From: "Daniel P. Berrange" <berrange@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Kazuo Tanaka <tanakakza@intellilink.co.jp>,
"MATSUDA, Daiki" <matsudadik@intellilink.co.jp>,
qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] GuestAgent: PIDFILE remains when daemon start fails
Date: Fri, 6 Jan 2012 17:05:53 +0000 [thread overview]
Message-ID: <20120106170553.GA15223@redhat.com> (raw)
In-Reply-To: <4F0728BA.6020106@linux.vnet.ibm.com>
On Fri, Jan 06, 2012 at 11:00:42AM -0600, Michael Roth wrote:
> On 01/06/2012 04:56 AM, Daniel P. Berrange wrote:
> >On Thu, Jan 05, 2012 at 06:18:26PM -0600, Michael Roth wrote:
> >>On 01/05/2012 04:26 PM, MATSUDA, Daiki wrote:
> >>>Hi, all.
> >>>
> >>>I am trying QEMU Guest Agent and encountered a small bug. It is that the
> >>>PIDFILE remains when daemon start fails. And maybe forgotton to g_free().
> >>>
> >>>MATSUDA, Daiki
> >>>
> >>
> >>Thanks for the patch. There was some contention in the past about
> >>whether or not to clean up pidfiles when there was abnormal
> >>termination, but personally I like this approach better.
> >
> >Yep, this still leaves open the problem of pidfile cleanup when the
> >daemon crashes. For libvirtd we recently switched over to a crash-safe
> >pidfile acquisition design, that uses fcntl(F_SETLK) to maintain
> >exclusive access over the pidfile. With this you don't need to worry
> >about forgetting to unlink() on termination, since the POSIX lock is
> >automatically released when process exits (or crashes).
>
> Yup, we did the same at some point via lockf(). An argument was made
> that stale PID files from unresolved crashes should stick around, so
> we dropped it. I think we should re-evaluate that decision...libvirt
> taking the same approach is pretty good precedence for me. I don't
> expect to have state from crashed programs interrupting attempts to
> restart them, it's more an unpleasant surprise than a feature, I
> think.
Yeah, I think that is rather unpleasant, particularly for something
like qemu guest agent, which we want to try to ensure is reliably
running. In any case, if qemu guest agent is being launched by
something like SystemD, then you can configure whether systemd
will auto-restart it when it dies with non-zero exit status, so
I don't think we should delibrately leave stale pidfiles for that
scenario.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2012-01-06 17:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 22:26 [Qemu-devel] [PATCH] GuestAgent: PIDFILE remains when daemon start fails MATSUDA, Daiki
2012-01-06 0:18 ` Michael Roth
2012-01-06 10:56 ` Daniel P. Berrange
2012-01-06 17:00 ` Michael Roth
2012-01-06 17:05 ` Daniel P. Berrange [this message]
2012-01-06 19:06 ` Luiz Capitulino
2012-01-06 20:09 ` Michael Roth
2012-01-06 20:18 ` Luiz Capitulino
-- strict thread matches above, loose matches on Subject: below --
2012-01-05 22:16 MATSUDA, Daiki
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=20120106170553.GA15223@redhat.com \
--to=berrange@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=matsudadik@intellilink.co.jp \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=tanakakza@intellilink.co.jp \
/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;
as well as URLs for NNTP newsgroup(s).