Open antwan opened 9 years ago
uWSGI is a bit different, see http://raven.readthedocs.org/en/latest/config/index.html#a-note-on-uwsgi
@xordoquy we actually talked in IRC and it seems this is an additional problem (beyond the threaded notes)
Note after more tests, this behavior can be reproduced even with Python threads support disabled (i.e messages go through the first process only, but they go trough).
This means for some reason the threading is not effective at all with uWSGI...
Maybe a solution might be to create a specific transport layer for uWSGI using their low-level threading api.
@Antwan86 we want to move away from all the custom transports as they're generally not needed. I'm sure this is just a case of the worker not correctly running after fork, but I haven't had a chance to look at it yet.
Hit similar issue but not sure if this's the same one.
My case is like this ... Django warnings RemovedInDjango19Warning can be sent to Sentry when uWSGI starts but all other log events afterwards are not sent. The queue size of the threaded HTTP transport keeps increasing for each new log events.
Environment.
Note: This problem did not occur when i was using Django 1.4.x 2 days ago.
I'm also affected, with Django 1.8.6. I also tested with Django 1.7, with which I could not reproduce it.
Tested with most raven 5.8.1 and uWSGI 2.0.11.2.
More info:
If in uWSGI configuration master process is disabled (master=false), and workers=1, then messages will get through. If more workers, it appears that only the messages that are sent from the first worker get through.
Looks like some thread locking issue that is trickered by Django 1.8 upgrade.
For the record, my 'workaround' solution for this was to implement redis based transport. https://gist.github.com/tuomas2/5f85df7dc90ea4c33f8b
I stuck in the same issue while I changed sentry logger level from ERROR to WARNING in django settings file. Now I can only get 504 gateway time-out
in django response.
environment * django 1.9 * raven 5.31.0 * uwsgi 2.0.11
@xordoquy Linked documentation doesn't exist anymore.
@luckydonald https://github.com/getsentry/raven-python/blob/master/docs/advanced.rst#a-note-on-uwsgi
basically you need enable threads in uwsgi that's all.
cc @dalang
I got away with using the non threaded sender class:
from raven.transport import HTTPTransport
client = raven.Client(transport=HTTPTransport)
You can force set sync HTTPTransport module as default transport module by Djnago settings:
RAVEN_CONFIG = {
'dsn': '...',
'transport': 'raven.transport.http.HTTPTransport'
}
Hi,
When trying to send events to the logging server with the default (threaded) transport mode and uWSGI as application server, the events are not sent provided the request is handled by a children spawned process.
Example :
The server :
uwsgi --http :8080 --module conf.wsgi --home venv --process 2 --enable-threads
The log :
Only 3 messages are sent to the server (the one being handled by PID 14124).
When terminating uWSGI :
Other example :
uwsgi --http :8080 --module conf.wsgi --home venv --process 3 --threads 2
Log :
Same with
--master
(in this case nothing is send), or--emperor
. Everything spawning processes prevent the messages from being sent. uWSGI v 2.0.10This should be related to PR #583 though this does not fix the issue.