[Django] #24816: Preventing duplicate signals

18 views
Skip to first unread message

Django

unread,
May 19, 2015, 3:34:24 AM5/19/15
to django-...@googlegroups.com
#24816: Preventing duplicate signals
--------------------------------------+---------------------
Reporter: timkofu | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: 1.8
Severity: Normal | Keywords: signals
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+---------------------
Hello,

In the docs here https://docs.djangoproject.com/en/1.8/topics/signals
/#preventing-duplicate-signals It implies that a receiver can be called
multiple times for the same event. When would this happen? Is it still a
problem in 1.8?

--
Ticket URL: <https://code.djangoproject.com/ticket/24816>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 19, 2015, 3:47:10 AM5/19/15
to django-...@googlegroups.com
#24816: Preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: timkofu | Owner: nobody
Type: | Status: closed
Cleanup/optimization |

Component: Core (Other) | Version: 1.8
Severity: Normal | Resolution: invalid

Keywords: signals | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by freakboy3742):

* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

The ticket tracker is for tracking known problems, not asking questions.
If you want to ask a question about usage, please use the Django-users
mailing list.

However; to answer your question: Yes, it is still a problem, and no,
there isn't much we can do about it (other than what is already listed in
in the docs). The problem is that due to Python's import process, it's
possible for the same module to be imported twice, resulting in a handler
being registered twice.

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:1>

Django

unread,
May 19, 2015, 4:23:08 AM5/19/15
to django-...@googlegroups.com
#24816: Preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: timkofu | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: invalid

Keywords: signals | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by kezabelle):

* component: Core (Other) => Documentation


Comment:

The reason `timkofu` has raised this ticket was because coming into IRC to
find out what the circumstances were didn't yield definitive results, and
while the phrasing of the original ticket may have left you thinking it
was a question for django-users, it's not, really. Given I was the one
suggesting opening a ticket to get the docs improved, I'm going to chime
in.

I have no idea what '''In some circumstances, the code connecting
receivers to signals may run multiple times''' might mean, these days,
given much of the problem stemmed (IIRC) from the old project layout
allowing for multiple import paths, and the lack of something like
AppConfig.ready.

If it is still a problem, as has been alluded to, the nature of how
multiple runs might be encountered ought to be documented rather than
just hand-waving it away as "''in some circumstances''" and leaving the
user wondering why they need `dispatch_uid`. There used to be a whole Wiki
page devoted to the issue; I'd hope if it's still an issue, some of the
explanation therein could be subsumed into the actual docs.
(Or just drop the whole bit entirely and document signals as taking a
dispatch_uid everywhere, given that is essentially the solution (and has
been for as long as I can remember))


I'm reclassifying this as documentation improvement, in the hope that it
could be re-opened on that basis.

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:2>

Django

unread,
May 19, 2015, 4:24:29 AM5/19/15
to django-...@googlegroups.com
#24816: Preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: timkofu | Owner: nobody

Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: invalid
Keywords: signals | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by kezabelle):

* cc: django@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:3>

Django

unread,
May 19, 2015, 7:40:37 AM5/19/15
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
--------------------------------------+------------------------------------

Reporter: timkofu | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: signals | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* status: closed => new
* resolution: invalid =>
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:4>

Django

unread,
Jun 30, 2020, 10:40:03 PM6/30/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: signals | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jason Held):

* owner: nobody => Jason Held
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:5>

Django

unread,
Jul 1, 2020, 12:07:00 AM7/1/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: signals | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/13131 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:6>

Django

unread,
Jul 8, 2020, 12:28:52 AM7/8/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:
Keywords: signals | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 1 => 0
* version: 1.8 => 3.1
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:7>

Django

unread,
Jul 8, 2020, 2:23:16 AM7/8/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed

Keywords: signals | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"639142e24d41c5e5a508cb1280f32fd7ff159cca" 639142e2]:
{{{
#!CommitTicketReference repository=""
revision="639142e24d41c5e5a508cb1280f32fd7ff159cca"
Fixed #24816 -- Clarified docs about preventing duplicate signals.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:8>

Django

unread,
Jul 8, 2020, 2:23:36 AM7/8/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: signals | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"703256fc681338bc227768a15c1f56851d05adae" 703256f]:
{{{
#!CommitTicketReference repository=""
revision="703256fc681338bc227768a15c1f56851d05adae"
[3.1.x] Fixed #24816 -- Clarified docs about preventing duplicate signals.

Backport of 639142e24d41c5e5a508cb1280f32fd7ff159cca from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:9>

Django

unread,
Jul 8, 2020, 2:27:02 AM7/8/20
to django-...@googlegroups.com
#24816: Clarify docs about preventing duplicate signals
-------------------------------------+-------------------------------------
Reporter: Timothy Makobu | Owner: Jason
Type: | Held
Cleanup/optimization | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: signals | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3ca2361d70b003019e4135413bdcc800bcbf99e5" 3ca2361d]:
{{{
#!CommitTicketReference repository=""
revision="3ca2361d70b003019e4135413bdcc800bcbf99e5"
[3.0.x] Fixed #24816 -- Clarified docs about preventing duplicate signals.

Backport of 639142e24d41c5e5a508cb1280f32fd7ff159cca from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24816#comment:10>

Reply all
Reply to author
Forward
0 new messages