tornadoweb / tornadoweb/tornado
Inconsistency in the IOStream.closed method
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22.2k
- Forks
- 5.6k
- Avg merge
- 3h 42m
- Merged PRs (30d)
- 16
Description
Hi,
The fix in the commit 501f596 caused a problem in my async web server application:
I expect IOStream.closed method to return true AS SOON AS the close_callback is called. (This was the previous behaviour since it was not waiting for the pending callbacks). Now, the closed() method returns true but the close_callback waits the pending callbacks to finish. Hence the connection is not actually closed. Is it the intended behaviour?
I expect the closed() method to return true after all pending callbacks finished AND the close_callback is called. Otherwise we cannot know if the connection is actually closed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating IOStream.closed and the close_callback path in Tornado's Python networking code. Compare the behavior described before and after commit 501f596, then determine from existing behavior or tests whether closed() should wait for pending callbacks and establish a clear completion condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100