qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "wangxin (U)" <wangxinxin.wang@huawei.com>
Cc: Peter Xu <peterx@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"quintela@redhat.com" <quintela@redhat.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] migration/fd: abort migration if receive POLLHUP event
Date: Wed, 25 Apr 2018 09:03:06 +0100	[thread overview]
Message-ID: <20180425080306.GC30024@redhat.com> (raw)
In-Reply-To: <8ADDA2EB7601DA429B6B2A43EF4620A55B76E463@DGGEMA503-MBX.china.huawei.com>

On Wed, Apr 25, 2018 at 07:29:05AM +0000, wangxin (U) wrote:
> 
> > -----Original Message-----
> > From: Peter Xu [mailto:peterx@redhat.com]
> > Sent: Wednesday, April 25, 2018 11:32 AM
> > To: Daniel P. Berrangé <berrange@redhat.com>
> > Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>; wangxin (U)
> > <wangxinxin.wang@huawei.com>; qemu-devel@nongnu.org;
> > quintela@redhat.com; Gonglei (Arei) <arei.gonglei@huawei.com>
> > Subject: Re: [PATCH] migration/fd: abort migration if receive POLLHUP event
> > 

> > Ah, wait.  I just noticed that Xin mentioned about the loop already -
> > it's an infinite loop of SIGHUP.  I suppose it means that we'll just
> > never go into fd_accept_incoming_migration() at all?
> 
> Yeah, that's what I want to fix.
> 
> > 
> > If so, I'm not sure whether we should just always watch on G_IO_HUP
> > (and possibly G_IO_ERR too) in qio_channel_create_watch():
> > 
> >   GSource *ret = klass->io_create_watch(ioc, condition | G_IO_HUP |
> > G_IO_ERR);
> > 
> > Otherwise I'm not sure the same loop will happen for other users of
> > qio_channel_add_watch().
> 
> In my scenario, it's clear the client quit immediately and we
> never got a POLLIN event, otherwise, 
> the watch should be unregistered when POLLIN event coming. 
> As Daniel said, normally G_IO_IN will be the first event, we
> need to find why POLLIN event never happened, I'll try it.

Yes, I have always been under the belief that you're guaranteed to get a
POLLIN event when the client closes the connection, in addition to the
POLLHUP event, but it sounds like that is not happening so I guess I'm
mistaken in that.

In this case, it should be sufficient to just add the G_IO_HUP|G_IO_ERR
events when creating the watch - probably no need to add extra code to
the fd_accept_incoming_migration() method.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

      reply	other threads:[~2018-04-25  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21  7:22 [Qemu-devel] [PATCH] migration/fd: abort migration if receive POLLHUP event Wang Xin
2018-04-24 17:16 ` Dr. David Alan Gilbert
2018-04-24 18:24   ` Daniel P. Berrangé
2018-04-25  3:14     ` Peter Xu
2018-04-25  3:31       ` Peter Xu
2018-04-25  7:29         ` wangxin (U)
2018-04-25  8:03           ` Daniel P. Berrangé [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=20180425080306.GC30024@redhat.com \
    --to=berrange@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=wangxinxin.wang@huawei.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;
as well as URLs for NNTP newsgroup(s).