[libvirt] [PATCH][libvirt-glib] Don't misuse GMainLoop for libvirt event loop
Jiri Denemark
jdenemar at redhat.com
Thu May 24 14:52:45 UTC 2012
On Thu, May 24, 2012 at 10:41:13 +0100, Daniel P. Berrange wrote:
> On Thu, May 24, 2012 at 11:01:19AM +0200, Michal Privoznik wrote:
> > Since we are calling APIs within timers, those might block as
> > any libvirt API may block. This, however, might get so critical,
> > that server will shut us down due to timeout on keepalive.
> > Simply, if an API called within a timer block, entire event loop
> > is blocked and no keepalive response can be sent.
> >
> > Therefore, delegate separate thread for such purpose.
>
> NACK, this is completely wrong. The keepalive code is what is broken
> here. If a thread is sitting in virNetClientIOEventLoop() waiting
> for an RPC reply, then this method should be handling the keepalives
> to prevent death of the connection.
Actually, now that you mentioned it, I looked at the code and it should be
quite easy to avoid using timer for sending keepalive responses (requests will
still use them, of course). I even remember it was one of the ways I
considered doing it but ended up with the timer :-)
Jirka
More information about the libvir-list
mailing list