New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream_framework.tasks.follow_many hangs in celery for cassandra backend #170
Comments
Also is there a user group where i can post clarifications and queries for stream-framework |
Are you using Celery with something other than RabbitMQ as the broker? Celery workers aren't always reliable with other broker backends. Especially at high load. Are you having this issue in development or production? |
I am using celery with rabbitmq and it is working perfectly fine for Redis backend. our app is in POC state and it is in development. |
This link seems to explain the behaviour that i encounter http://stackoverflow.com/questions/24785299/python-cassandra-driver-operationtimeout-on-every-query-in-celery-task BTW, if i do strace on the celery process which hungs, it gives me following Since you guys are already using cassandra + celery, i think i might be missing something on some setup. Any help is greatly appreciated |
It seems it has to do with sharing cassandra session across celery worker process. I had to put following in celery.py to ensure it is working fine. This also took care of keyspace creation and model sync in cassandra from celery.signals import worker_process_init, beat_init def cassandra_init(_args, *_kwargs): Initialize worker context for both standard and periodic tasks.worker_process_init.connect(cassandra_init) |
that's right, forgot about it. We should add this to the install documentation for Celery |
@aruljothi it's not a good idea to have the |
@tbarbugli I felt it, but since i kept that part of the code inside semaphore, it happens only once. What is your recommendation. The way i see it, it has to be called only once right?. |
no idea how you implemented the semaphore but I guess that only make sure On Tue, Mar 1, 2016 at 5:29 PM, Aruljothi notifications@github.com wrote:
|
i got it, currently i used redis lock to implement the semaphore which is accessible across servers. However i understand the spirit of your feedback. I'll see where i can fit it in. I have an unrelated query (i'll open a separate ticket if you want) I created my feed as shown below and it was working fine when i used Redis backend, but it fails with Cassandra at following location at stream_framework/storage/base.py (def serializer) 85 serializer_instance = serializer_class( where the serializer_class is CassandraActivitySerializer (defined below) and that expects model as a parameter in init(), but it is not provided here. I think i am missing something here. Can you please help me here. class MyAppFeed(CassandraFeed): Regards, |
@tbarbugli I have opened another ticket (171) for the above query, please review and help me on this. |
Friends,
I tried to port our Redis backend for Stream framework to Cassandra and followed the instructions along with ensuring keyspace and model creation (sync_table). But when i try to create a follow relationship or any stream framework operations for that matter involving running follow_many task on the celery just hung.
I could see following from the celery logs,
SELECT * FROM mystream.user_feed WHERE "feed_id" = %(0)s LIMIT 5000
Sending options message heartbeat on idle connection (139973351007568) cassandra
Sending options message heartbeat on idle connection (139973368092368) cassandra
Received options response on connection (139973368092368) from cassandra
Received options response on connection (139973351007568) from cassandra
if i use celery always eager, the task completes with success state.
Any help is greatly appreciated. Please let me know if you need any more details from my side.
Regards,
Aruljothi.S
The text was updated successfully, but these errors were encountered: