classification
Title: asyncore's urgent data management and connection closed events are broken when using poll()
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: giampaolo.rodola, intgr, josiah.carlson, josiahcarlson, r.david.murray
Priority: normal Keywords: patch

Created on 2008-12-03 01:10 by giampaolo.rodola, last changed 2009-04-12 17:28 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
asyncore.patch giampaolo.rodola, 2008-12-03 01:10 asyncore's loop() patch (including modified tests)
Messages (3)
msg76807 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-12-03 01:10
I discovered that some pyftpdlib [1] tests fail when using poll()
instead of select().
The problem is in asyncore.readwrite() function which erroneously calls
handle_read_event() in case of a POLLPRI event.

The patches modify readwrite() function so that:

- POLLPRI is now treated as synonym for "there is urgent data to read"
so handle_expt_event() is called.
- POLLHUP, POLLERR and POLLINVAL are now treated as synonyms for "the
connection has been closed" (Twisted behaves exactly the same) so
handle_close() is called.

Both pyftpdlib and asyncore tests passed on Linux Debian Etch and
FreeBSD 7.0-RC1.


[1] http://code.google.com/p/pyftpdlib/
msg77902 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2008-12-16 13:28
IMHO it would be good if this could go in the latest 2.4 and 2.5
upcoming releases while we still have the chance.
msg85912 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-04-12 17:28
Fixed as part of the work done on issue1161031.
History
Date User Action Args
2009-04-29 07:19:38georg.brandllinkissue1541 superseder
2009-04-12 17:28:32r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg85912

resolution: duplicate
stage: resolved
2009-03-28 12:12:22intgrsetnosy: + intgr
2008-12-20 14:30:41loewissetversions: - Python 2.5, Python 2.4, Python 2.5.3
2008-12-16 13:28:19giampaolo.rodolasetmessages: + msg77902
2008-12-15 18:48:06giampaolo.rodolasetversions: + Python 2.5, Python 2.4, Python 2.5.3
2008-12-03 01:10:51giampaolo.rodolacreate