fileno() gets called on a ReadDescriptor after removing it from the reactor
|Reported by:||wulczer||Owned by:||exarkun|
branch-diff, diff-cov, branch-cov, buildbot
The attached test case fails on HEAD twisted.
The use case is an object that wants to implement the IReadDescriptor interface and is getting added and removed to the reactor using reactor.addReader() and .removeReader().
More specifically, it is added to the reactor and after it becomes no longer usable (say, it has been closed by the user, or disposed in another way) and at which point fileno() can no longer return sensible values, it is removed from the reactor.
However fileno() still can get called on the object even after removing it from the reactor, hence the need to return, lacking any sensible values, -1 (the reason returning -1 works is explained in #2825, I believe). Since handling a -1 fileno is considered a crock (and rightfully so), this has to be considered a defect.
Change History (25)
Changed 6 years ago by wulczer
comment:12 Changed 6 years ago by itamar
- Keywords review removed
- Owner changed from glyph to exarkun
comment:21 Changed 5 years ago by exarkun
- Branch changed from branches/bad-fileno-call-4539 to branches/bad-fileno-call-4539-2