[Django] #27152: Comma-delimited servers list not supported in memcached caches `LOCATION`

5 views
Skip to first unread message

Django

unread,
Aug 30, 2016, 8:42:49 AM8/30/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
-------------------------------------+--------------------
Reporter: edmorley | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+--------------------
Currently Django's memcached backends only support a semicolon delimited
servers list in the cache config, such as:

{{{
CACHES = {
'default': {
'LOCATION': 'server1.foo.com;server2.foo.com',
},
}
}}}

This is because the backend
[https://github.com/django/django/blob/1.10/django/core/cache/backends/memcached.py#L16
just does]:
{{{
self._servers = server.split(';')
}}}

However cloud memcached offerings such as Memcachier and Memcached Cloud
typically use a comma-delimited list in the automatically set environment
variable, eg:

{{{
MEMCACHIER_SERVERS='foo.us-east-5.heroku.prod.memcachier.com:11211,bar.us-
east-5.heroku.prod.memcachier.com:11211'
}}}

Given that the caches `LOCATION` parameter contains only domain name and
port (and not say passwords), it should never contain a comma - so we
should be fine to also split on them too.

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

Django

unread,
Aug 30, 2016, 10:11:01 AM8/30/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Core (Cache system) | Version: 1.10
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 timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* type: Bug => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

I guess `server.replace(',', ';').split(';')` should work.

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

Django

unread,
Aug 31, 2016, 9:21:01 AM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: alexyer
Type: Cleanup/optimization | Status: assigned

Component: Core (Cache system) | Version: 1.10
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 alexyer):

* status: new => assigned
* owner: nobody => alexyer


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

Django

unread,
Aug 31, 2016, 9:42:43 AM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: edmorley
Type: Cleanup/optimization | Status: assigned

Component: Core (Cache system) | Version: 1.10
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 edmorley):

* owner: alexyer => edmorley


Comment:

Ah I have this finished locally already - sorry thought I'd set the ticket
assignee already!

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

Django

unread,
Aug 31, 2016, 9:43:53 AM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: edmorley
Type: Cleanup/optimization | Status: assigned
Component: Core (Cache system) | Version: 1.10
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 alexyer):

Ok. Not a problem.

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

Django

unread,
Aug 31, 2016, 10:22:29 AM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
--------------------------------------+------------------------------------
Reporter: edmorley | Owner: edmorley
Type: Cleanup/optimization | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
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 edmorley):

* cc: emorley@… (added)
* has_patch: 0 => 1


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

Django

unread,
Aug 31, 2016, 12:27:15 PM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
-------------------------------------+-------------------------------------
Reporter: edmorley | Owner: edmorley
Type: | Status: assigned
Cleanup/optimization |

Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | 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 timgraham):

* stage: Accepted => Ready for checkin


Comment:

Pending a few cosmetic edits.

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

Django

unread,
Aug 31, 2016, 5:24:00 PM8/31/16
to django-...@googlegroups.com
#27152: Comma-delimited servers list not supported in memcached caches `LOCATION`
-------------------------------------+-------------------------------------
Reporter: edmorley | Owner: edmorley
Type: | Status: closed
Cleanup/optimization |

Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution: fixed

Keywords: | 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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"d8ef5b0e6501692b8b767ebccddc936f496d77e8" d8ef5b0e]:
{{{
#!CommitTicketReference repository=""
revision="d8ef5b0e6501692b8b767ebccddc936f496d77e8"
Fixed #27152 -- Supported comma delimiter in memcached LOCATION string.
}}}

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

Reply all
Reply to author
Forward
0 new messages