posit-dev / posit-dev/py-shiny
[Bug]: Apps reload multiple times on save when `--reload` is used
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 135
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 21
Description
Component
Other
Severity
P3 - Low (minor inconvenience)
Shiny Version
1.4.0
Python Version
3.12
Minimal Reproducible Example
...
Behavior
When I'm working on an app.py file and running it with shiny --reload, saving the file causes shiny to restart two times.
Here's some example output from a single save:
WARNING: WatchFiles detected changes in 'examples/event/app.py'. Reloading...
INFO: Shutting down
INFO: connection closed
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [39459]
INFO: Started server process [40731]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:58860 - "GET /?_positronRender%3D5 HTTP/1.1" 200 OK
INFO: ('127.0.0.1', 58863) - "WebSocket /websocket/" [accepted]
INFO: connection open
WARNING: WatchFiles detected changes in 'examples/event/app.py'. Reloading...
INFO: Shutting down
INFO: connection closed
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.
INFO: Finished server process [40731]
INFO: Started server process [40733]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:58870 - "GET /?_positronRender%3D5 HTTP/1.1" 200 OK
INFO: ('127.0.0.1', 58873) - "WebSocket /websocket/" [accepted]
INFO: connection open
Error Messages (if any)
Environment
Mac
Contributor guide
No contributing guide indexed for this repository
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 reproducing the issue with shiny --reload while saving examples/event/app.py, using the provided restart logs as the expected failure pattern. Trace the reload entry point and verify that one save produces only one shutdown and restart; there is no specific source file or test named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100