Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by claudep):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 This is a duplicate of #15894.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.bfdbb8e587eb7618941ed825cc86d577%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by kezabelle):

 * cc: django@… (added)


Comment:

 Additional point for consideration: the default setting for
 `CACHES['default']` is `LocMemCache`, which would have the same problem as
 the current situation where other processes would not be notified of the
 change, as far as I know.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.b6ab6a79167a043fe2f11607ed162dc2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by patrys):

 `CACHES['default']` is something you control. If you use multiple
 processes, you should set it to a shared-state storage. This is something
 that Django should document and recommend.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.231851bfddb6d97ead51dde14c9d43eb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by patrys):

 I've filed this under “cleanup/optimization” but it also qualifies as a
 bug report. In any environment that use more than one process the cache
 will not invalidate properly.

 Consider two worker processes using the same `SITE_ID`. If one of them
 updates current `Site` object's `name` field, only this process will see
 signals being fired and only its own local cache will be invalidated. For
 every second request the old name will be seen.

 Django offers no inter-process messaging to notify other workers that
 their caches are no longer valid. To properly work around this problem you
 need to implement your own `get_current()` (using a shared-state cache
 like the cache framework) and monkey-patch either Django or your third-
 party dependencies.

 What's worse, `runserver` does not use multiple processes. The buggy
 behaviour is isolated to production environments and is impossible to
 reproduce locally.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.44540f5c4022ecaaa74cd43917f9cffa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timgraham):

 I'm not sure about this. The caching was added in #3766 to avoid database
 queries but with this change I think anyone using the database cache
 backend no longer gets any benefit.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d3dd69f894665aca191c28f2d5f705f5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-20 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
-+-
 Reporter:  patrys   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  contrib.sites|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by patrys):

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


Comment:

 Pull request: https://github.com/django/django/pull/5692

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.409fa58c5535137439649481f02c04f0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #25783: Site.objects.get_current() should use Django's cache framework

2015-11-19 Thread Django
#25783: Site.objects.get_current() should use Django's cache framework
--+
 Reporter:  patrys|  Owner:  nobody
 Type:  Cleanup/optimization  | Status:  new
Component:  contrib.sites |Version:  1.8
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Currently sites are cached using a module global. This solution makes it
 impossible to edit the site object in multiprocess environments as it's
 impossible to notify other processes that they need to invalidate local
 caches. Having to restart all servers/workers after a database operation
 is not intuitive.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.728856aeb641d411fa409f9f07aaed1d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.