Skip to content

Proposing an easy method for graceful application shutdown #198

Open
@drone115b

Description

@drone115b

I think there's an appetite for waitress to be able to shutdown applications gracefully. I use waitress independently of pylons for a wide variety of micro-services.

On line 263 of server.py, SystemExit and KeyboardInterrupt exceptions are caught to shut down the task dispatcher.

I am not very fluent with the code, but if there was a "raise" call inserted after line 264, then it seems that higher-level exception handlers could be used to catch the same exceptions and shut down the application object gracefully.

Is there an argument against this? Have I misunderstood the code?

I think the pros are: 1-line (1-word!) solution, highly backwardly compatible, seems like it would address graceful application shutdown robustly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions