celery-haystack
celery-haystack copied to clipboard
When using a database table broker, django-celery-transactions breaks commit_on_success decorator
This is a curious one; I'm only guessing this is the right project to report the bug; I don't see an obvious way to fix it though, and it is a bit of an edge case.
- My function uses
@transaction.commit_on_success. - It saves a model instance that is attached to a search index.
- Via a post_save hook,
celery-haystackwants to send the update task to celery. django-celery-transactionsholds the task back for now.- My function ends,
commit_on_successexecutes aCOMMIT, sets the connectionis_dirtyflag to False. django-celery-transactions, via it'spost_commitpatching, now triggers the celery task sends.- Since I'm using the database broker, the database connection is dirtied again in this step.
- Finally, the code of Django's
commit_on_successdecorator callsleave_transaction_management, which checks the dirty flag and fails with: ```django-celery-transactions`.
This is using Django 1.5 and Haystack 2 Beta.
Oh man, what a mess. Is there any way to easily reproduce it? Or a traceback? Not sure if this really can be done here, but I'd love to fix this of course.