Changes between Initial Version and Version 1 of Ticket #37406
- Timestamp:
- Oct 7, 2026, 3:35:37 AM (2 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37406 – Description
initial v1 3 3 After that the connection is stuck. `in_atomic_block` is True with no atomic block on the stack, so nothing will ever commit. Once anything sets `needs_rollback` you get `TransactionManagementError` on every query. `close()` doesn't help because inside an atomic block it keeps the dead connection object around and waits for an `Atomic.__exit__` to reset it. 4 4 5 This doesn't affect manage.py migrate from a shell, since the process exits and the server rolls back. It matters if you catch the error and keep going, e.g. tests, `call_command("migrate")`, or a tool using MigrationExecutor directly.5 This doesn't affect manage.py migrate from a shell, since the process exits and the server rolls back. It matters if you catch the error and keep going, e.g. tests, `call_command("migrate")`, or a tool using schema_editor directly. 6 6 7 7 There is an existing `test_migrations_not_applied_on_deferred_sql_failure` but it has `atomic = False` so it doesn't hit this.