any way to graceful exit tornado application?

Open
#1,791 19 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Begin with the IOLoop, _callbacks, and _timeouts references in the report, then trace Tornado's application and HTTP-server shutdown entry points. Check existing tests or documentation for shutdown behavior; done should establish a supported graceful-exit path or clearly document whether these private attributes are safe to use.

Written by the indexing model from the issue text.

Description

docs

there are many gist show how to graceful exit tornado application like this:

stop_httpserver(http_server)
def try_stop_ioloop():
    io_loop = IOLoop.instance()
    if io_loop._callbacks or io_loop._timeouts:
        io_loop.add_timeout(time.time()+1, try_stop_ioloop)
    else:
        io_loop.stop()

try_stop_ioloop()

it's safy to test io_loop._timeouts or _callbacks ? or _timeouts can be ignored?

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

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.

More from tornadoweb/tornado

All issues in tornadoweb/tornado

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.