This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients François-Xavier.Bourlet, neologix, xdegaye
Date 2011-11-03.17:56:12
SpamBayes Score 1.1503646e-07
Marked as misclassified No
Message-id <1320342972.89.0.343789711544.issue12498@psf.upfronthosting.co.za>
In-reply-to
Content
> The reason is that when TestHandler closes the connection after 
> writing the output buffer, the client receives a POLLHUP which 
> prevents it to receive the data since POLLHUP is triggering a call to 
> handle_close.

Yes, that's the problem it noticed in http://bugs.python.org/issue12498#msg146645 :
"""
(Note that the current code is probably broken: when POLLHUP is
received, this likely means that the remote end has shutdown the
connection, but there might still be some data in the input socket
buffer. I'll try to dig a little...).
"""

I think the best would be to not handle POLLHUP events while POLLIN is set, so that the handlers can have a chance to drain the input socket buffer.
But it's a separate issue, could you create a new one?
You may also add a patch (in the same issue) to remove the useless setting of input flags to poll():
"""
        if flags:
            # Only check for exceptions if object was either readable
            # or writable.
            flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL
            pollster.register(fd, flags)
"""

POLLERR, POLLHUP and POLLNVAL don't make sense when passed as input to poll() (they're set automatically in the output revents).
History
Date User Action Args
2011-11-03 17:56:12neologixsetrecipients: + neologix, xdegaye, François-Xavier.Bourlet
2011-11-03 17:56:12neologixsetmessageid: <1320342972.89.0.343789711544.issue12498@psf.upfronthosting.co.za>
2011-11-03 17:56:12neologixlinkissue12498 messages
2011-11-03 17:56:12neologixcreate