classification
Title: select.epoll calling register with the same fd fails
Type: behavior Stage: resolved
Components: Documentation, Extension Modules Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: barry, christian.heimes, georg.brandl, ionelmc, r.david.murray
Priority: critical Keywords: patch

Created on 2008-09-12 15:51 by ionelmc, last changed 2009-05-31 20:05 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
epoll.patch christian.heimes, 2008-09-12 16:25
Messages (7)
msg73096 - (view) Author: Ionel Cristian Mărieș (ionelmc) Date: 2008-09-12 15:51
The docs on epoll object's register method say: "Registering a file
descriptor that’s already registered is not an error, and has the same
effect as registering the descriptor exactly once."

However when calling register twice with the same fd it will fail with a
bogus "IOError: [Errno 17] File exists" error.
msg73098 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-12 15:56
I'll look into it. kqueue should be checked for the issue, too.

Barry: I don't think it's a release blocker but it's your call.
msg73100 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2008-09-12 15:58
Not a blocker.
msg73104 - (view) Author: Ionel Cristian Mărieș (ionelmc) Date: 2008-09-12 16:10
Why don't just fix the docs ?
I think it's consistent with the epoll api the way it is now.
msg73105 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-12 16:25
It's not consistent with Python's select.poll API. But exarkun and I
think that an exception is fine here. The exception makes it easier to
spot issues.

The patch updates the docs and adds some tests for corner cases to
test_epoll.py
msg73107 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-09-12 17:04
This should be removed from the docs patch:

-   Register a fd descriptor with the epoll object.
+  Register a fd descriptor with the epoll object.
msg88606 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-05-31 20:05
Committed (with fix to doc patch) to trunk in r73077, 26 in r73078, py3k
in r73079, and 30 in r73081.
History
Date User Action Args
2009-05-31 20:05:48r.david.murraysetstatus: open -> closed

versions: + Python 3.1, Python 2.7
nosy: + r.david.murray

messages: + msg88606
resolution: fixed
stage: resolved
2008-09-12 17:04:24georg.brandlsetmessages: + msg73107
2008-09-12 16:25:52christian.heimessetfiles: + epoll.patch
keywords: + patch
messages: + msg73105
2008-09-12 16:10:21ionelmcsetmessages: + msg73104
2008-09-12 15:58:24barrysetmessages: + msg73100
2008-09-12 15:56:50christian.heimessetpriority: critical
nosy: + barry
messages: + msg73098
versions: - Python 3.1, Python 2.7
2008-09-12 15:54:02georg.brandlsetassignee: georg.brandl -> christian.heimes
nosy: + christian.heimes
2008-09-12 15:51:44ionelmccreate