Opened 5 years ago

Last modified 5 years ago

#6373 defect new

Adding a new filedescriptor to epoll reactor should not result in ENOENT

Reported by: Itamar Turner-Trauring Owned by: Itamar Turner-Trauring
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/resurrected-fd-6373
branch-diff, diff-cov, branch-cov, buildbot
Author: itamarst


In certain mysterious situations (see #6346) info from an old filedescriptor remains in the reactor state; this can break adding a new filedescriptor with the same fd number, e.g. resulting in a ENOENT.

This ticket covers dealing gracefully with this problem, effectively a workaround that mitigates the original issue (still being covered by #6346). A workaround is useful even if we solve #6346 insofar as it makes the reactor more robust against future bugs.

Change History (4)

comment:1 Changed 5 years ago by itamarst

Author: itamarst
Branch: branches/resurrected-fd-6373

(In [37532]) Branching to 'resurrected-fd-6373'

comment:2 Changed 5 years ago by Itamar Turner-Trauring

Keywords: review added is running.

I punted the poll issue, discovered by the new test, to #6374.

comment:3 Changed 5 years ago by therve

Keywords: review removed
Owner: set to Itamar Turner-Trauring


  • Maybe we should share some more code with poll. Ticket?
  • Maybe remove should catch the same problem. TIcket?
  • "close()ed" is really weird, I don't know if it's intentional. You should not use "should", too.
  • The removeReader call at the end of the test is most likely unneeded
  • The new test is failing for kqueue and cfreactor.
  • twistedchecker is complaining:
    ************* Module twisted.internet.epollreactor
    C0301:239,0: Line too long (84/79)
    ************* Module twisted.internet.test.test_fdset
    W9015:379,0: Too many blank lines, expected 2

comment:4 Changed 5 years ago by Itamar Turner-Trauring

kqueue and cfreactor can also be addressed by separate tickets, and until then just skip the test on those reactors.

Note: See TracTickets for help on using tickets.