tornadoweb / tornadoweb/tornado

Any particular reason why calls to _handle_request_exception(e) or on_finish() are not being awaited ?

Open
#3,038 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

Any particular reason why methods calls to _handle_request_exception(e) or on_finish() are not being awaited ?

https://github.com/tornadoweb/tornado/blob/1db5b45918da8303d2c6958ee03dbbd5dc2709e9/tornado/web.py#L1709

In my implementation I'm overwriting these methods, but I need async support on them. I was trying to use asyncio functionality to handle my async calls , but it doesn't work properly in my project.

It's much easier to make a sync call from an async method then to make an async call from a sync method.

Thanks

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 in tornado/web.py at the linked code around line 1709 and trace the calls to _handle_request_exception(e) and on_finish(). Review their call sites and overrides to understand the synchronous API assumptions; completion would require a documented decision and compatible async behavior, with relevant coverage identified before implementation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.