AnemoneLabs / unmessage

Privacy enhanced instant messenger
GNU General Public License v3.0
43 stars 7 forks source link

Fix `IOError` caused when losing connections #25

Closed felipedau closed 7 years ago

felipedau commented 7 years ago

He have not been able to fix the following error yet:

Traceback (most recent call last):
  [...]
  File "/home/user/unmessage/peer.py", line 1356, in remove_manager
    self.transport.loseConnection()
  File "/home/user/env/local/lib/python2.7/site-packages/twisted/internet/abstract.py", line 408, in loseConnection
    self.startWriting()
  File "/home/user/env/local/lib/python2.7/site-packages/twisted/internet/abstract.py", line 442, in startWriting
    self.reactor.addWriter(self)
  File "/home/user/env/local/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 127, in addWriter
    EPOLLOUT, EPOLLIN)
  File "/home/user/env/local/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 96, in _add
    self._poller.register(fd, flags)
IOError: [Errno 17] File exists

It rarely occurs but when it does it is always caused by unMessage losing an existing connection to another peer when quitting. Someone experienced with Twisted might be able to help us.

felipedau commented 7 years ago

It has been a really long time since I re-encountered this issue. I believe this was caused by the bad handling of the reactor. I do not think it occurred since #21 was implemented, so I am going to assume it was fixed.