Skip to content

Python 3.12: Shiny refuses to shut down until all network connections are closed #771

Open
@daattali

Description

@daattali

I just installed py-shiny on a fresh Windows installation. I'm getting an issue where any time the shiny app is killed, the terminal freezes. If I run a shiny app with shiny run, then when I press ctrl+C I see messages saying that the shiny app is attempting to shut down, but the terminal gets stuck and never returns to the prompt.

If I run in --reload mode, then the moment I change a file and save it, the terminal gets to the same state.

This happens in the command line and also in VSCode.

(venv) C:\Users\Dean\Documents\R\python\shinytest>shiny run
←[32mINFO←[0m:     Started server process [←[36m16176←[0m]
←[32mINFO←[0m:     Waiting for application startup.
←[32mINFO←[0m:     Application startup complete.
←[32mINFO←[0m:     Uvicorn running on ←[1mhttp://127.0.0.1:8000←[0m (Press CTRL+C to quit)
←[32mINFO←[0m:     127.0.0.1:49687 - "←[1mGET / HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m:     ('127.0.0.1', 49689) - "WebSocket /websocket/" [accepted]
←[32mINFO←[0m:     connection open
←[32mINFO←[0m:     127.0.0.1:49688 - "←[1mGET / HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m:     connection closed
←[32mINFO←[0m:     ('127.0.0.1', 49695) - "WebSocket /websocket/" [accepted]
←[32mINFO←[0m:     connection open
←[32mINFO←[0m:     Shutting down

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions