﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37479	Run async signal receivers sequentially	Mykhailo Havelia	Mykhailo Havelia	"Since async signal support was added, `Signal.send()` and `Signal.asend()` run async receivers concurrently. This causes two problems:

 * '''Registration order is lost.''' In sync Django, receivers run in the order they were registered, and projects often rely on this for good reasons. With async receivers, the order is lost silently, so converting a receiver from sync to async can change behavior.
 * '''Transactions inside receivers are not well ordered.''' Since each receiver runs in its own task, their queries and savepoints can interleave. This came up in the review of async `transaction.atomic()` (#33882, [https://github.com/django/django/pull/22074 PR #22074]): receivers can't use `atomic()` inside an async transaction, and inside a sync transaction a write from one receiver can be silently rolled back with another receiver's savepoint.

'''Proposal:''' await async receivers one by one, in registration order, in the caller's task. This keeps the same semantics as sync receivers and makes transaction handling inside receivers safe.

'''Trade-off:''' slow receivers would no longer run concurrently. This is a behavior change and would need a release note."	Cleanup/optimization	assigned	Core (Other)	6.1	Low		async signals transaction	Mykhailo Havelia	Accepted	0	0	0	0	0	0
