#35801: Signals are dispatched to receivers associated with dead senders
------------------------------+------------------------------------
     Reporter:  bobince       |                    Owner:  (none)
         Type:  Bug           |                   Status:  new
    Component:  Core (Other)  |                  Version:  5.1
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------
Comment (by Simon Charette):

 > In my case this resulted in post-migrate hooks for the wrong apps being
 occasionally called in migration tests that mutated INSTALLED_APPS causing
 AppConfig senders to be re-created

 Could you provide a minimal project demonstrating the issue in a non-
 synthetic manner? Before we commit to a solution (which yours appear to be
 correct from a quick look) we'd want to establish under which organic
 conditions the problem can be reproduced.

 The Django test suite has many instances of
 `@override_settings(INSTALLED_APPS)` and doesn't run into this issue and
 I'm not sure it's fair to expect Django to behave properly under memory
 pressure circumstances that make `id` and therefore `hash` (as the default
 implementation of `__hash__` is `id()` based) to return the same value for
 two distinct objects.

 I think a possible alternative solution could be to identify under which
 organic circumstances this problem is likely to happen, document that
 signal connected with a sender must be disconnected prior to the object
 being garbage collected, and adjust the infringing cases within the
 framework itself.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35801#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019273fdb542-93de511e-87ac-437e-a410-5cb9e4d5d29a-000000%40eu-central-1.amazonses.com.

Reply via email to