netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johnpol@2ka.mipt.ru
Cc: shemminger@linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [Bug 8013] New: select for write hangs on a socket after write returned ECONNRESET
Date: Wed, 21 Feb 2007 22:45:43 -0800 (PST)	[thread overview]
Message-ID: <20070221.224543.95508003.davem@davemloft.net> (raw)
In-Reply-To: <20070216183426.GA3138@2ka.mipt.ru>

From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Date: Fri, 16 Feb 2007 21:34:27 +0300

> Otherwise we can extend select output mask to include hungup too
> (getting into account that hungup is actually output event).

POLLHUP is non-maskable and this is very clearly defined in
just about every Unix definition of poll().

This non-maskability leads to all the strange semantics in this area.

There is simply no way for sockets to return HUP for someone who
is only waiting to write.  Definitions of POLLHUP include language
such as "This event and POLLOUT are mutually exclusive".

I reviewed the current code and the many (and I mean MANY) threads on
this topic that have occurred over the years going back to even 1999,
and what we're doing now is the best possible set of semantics we can
provide without breaking any existing applications.

How many others have gone into the archives and actually looked at
the discussions?   That appears to be going out of style :-/

Now, on the read side, for the epoll folks, we added a POLLRDHUP
to handle that case.  It's not relevant here, but I'm mentioning it
in passing since it's roughly related and it shows part of the devil
in dealing with POLLHUP semantics.

POLLHUP is a complete mess, because it means different things on
different kinds of fds.  And exactly, because it is not maskable,
this makes it totally useless for sockets.

  parent reply	other threads:[~2007-02-22  6:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-16  0:04 Fw: [Bug 8013] New: select for write hangs on a socket after write returned ECONNRESET Stephen Hemminger
2007-02-16 15:25 ` Evgeniy Polyakov
2007-02-16 15:28   ` Evgeniy Polyakov
2007-02-16 15:39     ` Evgeniy Polyakov
2007-02-16 15:54       ` Evgeniy Polyakov
2007-02-16 16:10         ` Evgeniy Polyakov
2007-02-16 18:29           ` Stephen Hemminger
2007-02-16 18:34             ` Evgeniy Polyakov
2007-02-17 16:25               ` Evgeniy Polyakov
2007-02-19 14:19                 ` Jarek Poplawski
2007-02-22  6:47                 ` David Miller
2007-02-22  6:45               ` David Miller [this message]
2007-02-22 12:14                 ` Evgeniy Polyakov
2007-02-22 13:31                   ` David Miller
2007-02-22 13:46                     ` Evgeniy Polyakov
2007-02-22 14:08                       ` David Miller
2007-02-22 18:24                         ` Stephen Hemminger

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=20070221.224543.95508003.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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).