tornadoweb / tornadoweb/tornado

tcpclient: Improper close of IOStream

Open
#1,920 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tcpclient
Dominant language
Python
Stars
22.2k
Forks
5.6k
Avg merge
3h 42m
Merged PRs (30d)
16

Description

Hello,
I am using the latest git master. This happens when the IOLoop is busy. Seems simlar to #32 and #1901:

DEBUG:tornado.general:Error deleting fd from IOLoop
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1054, in run
    yielded = self.gen.send(value)
  File "/usr/local/lib/python3.5/dist-packages/tornado/tcpclient.py", line 175, in connect
    raise gen.Return(stream)
tornado.gen.Return: <tornado.iostream.SSLIOStream object at 0x7f0e70dba3c8>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tornado/ioloop.py", line 739, in remove_handler
    self._impl.unregister(fd)
FileNotFoundError: [Errno 2] No such file or directory

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tornado/tcpclient.py at connect and follow the cleanup path into tornado/ioloop.py remove_handler, using the reported busy-IOLoop condition and related issues #32 and #1901 as context. Reproduce the FileNotFoundError involving SSLIOStream, then add regression coverage and confirm that closing the stream no longer logs an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.