Comments (6)
I guess this is the result of connection handling mechanics. Websocket handshake will be in open state until websocket.connect consumer return {'accept': True} or similar result. If websocket.connect channel is full, incoming connection is closed with 503 error code. I don't know why time to connect increases exponential. Default channel capacity is 100 so it explains the last situation. Try to increase websocket.connect capacity with channel_capacity argument of channel layer.
from daphne.
Daphne shouldn't be closing connections without any response - is there any console logging from it when this is happening? Do you know what WebSocket close code you get in the browser?
from daphne.
There is no console logging at all (except of the CONNECT, HANDSHAKING and DISCONNECT messages). I also don't get any WebSocket close code. It seems, as if the tcp socket is closed before the websocket handshake is finished. The golang error message is: connection reset by peer
I run my tests again and came to much better results (but there are still lost connections). It "feels" like it is better, when i flush the redis db. But I am not sure. I also get the same errors, when I switch to the asgi inmemory backend.
I looked in the redis-db and it seems, that there are as as many keys in the form "asgi:websocket.send!PVPpOgmJFeV" as there are lost connections.
I tried for some time to reproduce the error with only a few clients by altering some parts of daphne or the asgi_redis backend but could not make it.
I have nomore ideas, how to debug this.
from daphne.
No error at all is unexpected; even if it errors out somewhere in the Python processing you should get a Twisted traceback at minimum. I'm not sure there's much I can do at this point, but any more information might help!
from daphne.
You can get the same behaviour, when you lower the open file limit for daphne (withulimit -n 20
). Then you also get a closed connection without any error message or traceback.
But this is not the problem with this issue. With this issue you can have all connections opend in the end. When you set a low open file limit, then there can't be more then $(ulimit -n) - 10
open connections.
from daphne.
Entire websocket handling code is rewritten to not be as nasty and I haven't been able to replicate this, closing.
from daphne.
Related Issues (20)
- how to set websocket send buffersize in daphne
- issuse when i using daphe in my django app with streaminghttpresponse HOT 7
- Can daphne run WSGI apps? HOT 6
- Does daphne have a file for initialization?
- Requests with Transfer-Encoding: chunked have no content HOT 14
- StreamHttpResponse with sync operations break in Daphne HOT 5
- Memory usage: Daphne loading all the file in memory (POST request) HOT 7
- Text streaming buffered issue
- Implement WebSocket Denial Response extension HOT 8
- [feature request] trailing headers HOT 1
- Add support for Python 3.12
- DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 1
- Daphne with self signed ssl HOT 2
- Daphne allows invalid characters within header names HOT 5
- Unix File Socket Argument HOT 12
- TypeError: object HttpResponse can't be used in 'await' expression HOT 3
- add support for --proxy-headers and friends in runserver HOT 4
- fd_endpoint.py is not properly installed HOT 7
- python manage.py runserver not working HOT 5
- Daphne - Twisted custom cipher list using set_cipher method HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daphne.