From: Manuel Bouyer <bouyer@antioche.eu.org>
To: "Jürgen Groß" <jgross@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: xenstored file descriptor leak
Date: Wed, 3 Feb 2021 09:16:21 +0100 [thread overview]
Message-ID: <20210203081621.GD445@antioche.eu.org> (raw)
In-Reply-To: <7768ff4b-837d-965b-61c7-b6794f677d9e@suse.com>
On Wed, Feb 03, 2021 at 09:05:27AM +0100, Jürgen Groß wrote:
> > > [...]
> > > Yes, I think this is a good idea.
> >
> > Well, after some sleep I don't think it is. We should always keep at last
> > POLLIN or we will never notice a socket close otherwise.
>
> Adding the fd of an ignored socket connection to the list is the real
> problem here. Why should that be done?
If we don't do it, we never notice when the socket is closed and the file
descriptor will stay forever. When I tried it, I had about 50 zombie
file descriptors open in xenstored, after starting only 2 domains.
> > > >
> > > > Now I wonder if, on NetBSD at last, a read error or short read shouldn't
> > > > cause the socket to be closed, as with:
> > > >
> > > > @@ -1561,6 +1565,8 @@
> > > > bad_client:
> > > > ignore_connection(conn);
> > > > + /* we don't want to keep this connection alive */
> > > > + talloc_free(conn);
> > > > }
> > >
> > > This is wrong for non-socket connections, as we want to keep the domain
> > > in question to be known to xenstored.
> > >
> > > For socket connections this should be okay, though.
> >
> > What are "non-socket connections" BTW ? I don't think I've seen one
> > in my test.
>
> Every connection to another domain.
>
> > Is there a way to know if a connection is socket or non-socket ?
>
> Active socket connections have conn->fd >= 0.
OK, I'll rework my patch. Thanks
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
next prev parent reply other threads:[~2021-02-03 8:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 18:37 xenstored file descriptor leak Manuel Bouyer
2021-02-03 6:18 ` Jürgen Groß
2021-02-03 7:57 ` Manuel Bouyer
2021-02-03 8:05 ` Jürgen Groß
2021-02-03 8:16 ` Manuel Bouyer [this message]
2021-02-03 8:21 ` Jürgen Groß
2021-02-03 11:48 ` Manuel Bouyer
2021-02-03 11:54 ` Jürgen Groß
2021-02-03 12:03 ` Manuel Bouyer
2021-02-03 12:13 ` Jürgen Groß
2021-02-03 12:17 ` Manuel Bouyer
2021-02-03 12:21 ` Jürgen Groß
2021-02-03 12:33 ` Manuel Bouyer
2021-02-03 12:42 ` Jürgen Groß
2021-02-03 12:47 ` Manuel Bouyer
2021-02-03 12:58 ` Jürgen Groß
2021-02-03 13:03 ` Manuel Bouyer
2021-02-03 13:11 ` Jürgen Groß
2021-02-03 13:24 ` Manuel Bouyer
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=20210203081621.GD445@antioche.eu.org \
--to=bouyer@antioche.eu.org \
--cc=jgross@suse.com \
--cc=xen-devel@lists.xen.org \
/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).