Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created February 6, 2017 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miohtama/6f87ca494df96a8d8894812106cadbbc to your computer and use it in GitHub Desktop.
Save miohtama/6f87ca494df96a8d8894812106cadbbc to your computer and use it in GitHub Desktop.
SQLAlchemy + PostgreSQL + deadlock on TransactionRollbackError retryable
Celery task raised an exception (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (psycopg2.extensions.TransactionRollbackError) deadlock detected
DETAIL: Process 18932 waits for ShareLock on transaction 166111; blocked by process 18933.
Process 18933 waits for ShareLock on transaction 166110; blocked by process 18932.
HINT: See server log for query details.
CONTEXT: while updating tuple (15,4) in relation "asset_content"
[SQL: 'UPDATE asset_content SET updated_at=%(updated_at)s, published_at=%(published_at)s, other_data=%(other_data)s WHERE asset_content.id = %(asset_content_id)s'] [parameters: {'published_at': datetime.datetime(2017, 2, 6, 10, 35, 42, 637436, tzinfo=datetime.timezone.utc), 'updated_at': datetime.datetime(2017, 2, 6, 10, 35, 42, 637430, tzinfo=datetime.timezone.utc), 'asset_content_id': UUID('3377ace2-0010-482d-a337-1703de763760'), 'other_data': '{"tags": [{"term": "Bitcoin", "label": null, "scheme": null}, {"term": "Trading", "label": null, "scheme": null}, {"term": "Monero", "label": null, " ... (2208 characters truncated) ... u collect profits. Are you outperforming the market though?</p></p>"}, "authors": [{"name": "CoinTelegraph"}], "author": [{"name": "CoinTelegraph"}]}'}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment