Re: [Django] #23642: LocMemCache.incr is not thread safe

2014-10-12 Thread Django
#23642: LocMemCache.incr is not thread safe
-+
 Reporter:  tchaumeny|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Cache system)  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Loic Bistuer ):

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


Comment:

 In [changeset:"6448dd833524ac3fc503506b624841c9d642de8a"]:
 {{{
 #!CommitTicketReference repository=""
 revision="6448dd833524ac3fc503506b624841c9d642de8a"
 Fixed #23642 -- Made LocMemCache.incr() thread-safe as documented
 }}}

--
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/067.63a8312edd0a451b90892549cf6afe78%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23642: LocMemCache.incr is not thread safe

2014-10-12 Thread Django
#23642: LocMemCache.incr is not thread safe
-+
 Reporter:  tchaumeny|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Cache system)  |  Version:  master
 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
-+
Changes (by loic):

 * stage:  Unreviewed => Accepted


--
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/067.25da0b2a3fd2adb84596eb6823af92e3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23642: LocMemCache.incr is not thread safe

2014-10-11 Thread Django
#23642: LocMemCache.incr is not thread safe
-+
 Reporter:  tchaumeny|  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Core (Cache system)  |Version:  master
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+
 `LocMemCache` is documented as being thread-safe, but its `incr` operation
 isn't: there is not lock wrapping the whole get+set operation.

 The code below demonstrates the issue:

 {{{
 import threading

 from django.core.cache.backends.locmem import LocMemCache

 cache = LocMemCache('test', {})

 cache.set('foo', 0)

 def increment(key):
 cache.incr(key)

 threads = []
 for i in range(20):
 t = threading.Thread(target=increment, args=('foo',))
 t.start()
 threads.append(t)

 for t in threads:
 t.join()

 print cache.get('foo')   # Random results — 20 is expected
 }}}

--
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/052.d120a07c0c3be8ccef5206f5b1569406%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.