KEEP_ALIVE_TIMEOUT causing the changes in server (mode debug) to be delayed?
See original GitHub issueDescribe the bug When running Sanic with the following options:
app.run(auto_reload=True, debug=True)
If I make any changes to my code and refresh, the new code is not taken into consideration. I need to wait a few seconds, and I’ll see the following message in the console:
[DEBUG] KeepAlive Timeout. Closing connection.
Reading the documentation, settings KEEP_ALIVE to False in dev mode would solve my issue, but it doesn’t change anything. The error still is displayed after about 8 seconds.
What can I do to have my new code refreshed immediately when running Sanic?
Expected behavior New code executed on refresh, not the previous one.
Environment (please complete the following information):
- OS: Fedora 24
- Version: 21.6.2
- Python: 3.8.10
Issue Analytics
- State:
- Created 2 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
Stop annoying session keep alive message in ssh login
This will cause the client to keep the connection alive without ever triggering the server's keep-alive timeout.
Read more >TCP Keepalive Best Practices - detecting network drops and ...
Analyze and resolve that problem to prevent the initial job failure. As a work-around, to detect network drops more quickly, and retry jobs ......
Read more >MQTT Keep Alive Interval Explained With Examples
The keepalive is 6 seconds. The debug logging is set so that you see more detail on what is happening you can set...
Read more >Avoiding the Top 10 NGINX Configuration Mistakes
To change the log directory, include the -e <error_log_location> ... Mistake 3: Not Enabling Keepalive Connections to Upstream Servers.
Read more >HTTP persistent connection - Wikipedia
HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can provide a reproducible example, but probably not until Monday, so don’t be surprised if I don’t post anything until then 😃
Currently (with or without my changes) REQUEST_TIMEOUT is completely useless. It only affects someone typing in a request over netcat because normally all headers are received in a millisecond, and confusingly enough RESPONSE_TIMEOUT is the one that actually covers the request body. I might prefer a more simplified timeout system with the ability to implement advanced logic in a streaming handler or via a middleware, if needed (e.g. an app could reset the timer after every I/O if it wants). But obviously that is another topic and not something that I would look into right now.