Skip to content
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

When using a database table broker, django-celery-transactions breaks commit_on_success decorator #17

Open
miracle2k opened this issue May 1, 2013 · 1 comment

Comments

@miracle2k
Copy link

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-haystack wants to send the update task to celery.
  • django-celery-transactions holds the task back for now.
  • My function ends, commit_on_success executes a COMMIT, sets the connection is_dirty flag to False.
  • django-celery-transactions, via it's post_commit patching, 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_success decorator calls leave_transaction_management, which checks the dirty flag and fails with: ```django-celery-transactions`.

This is using Django 1.5 and Haystack 2 Beta.

@jezdez
Copy link
Contributor

jezdez commented May 8, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants