Swift MemcacheConnPool does not support IPv6

Bug #1526570 reported by Timur Alperovich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Timur Alperovich

Bug Description

In the MemcacheConnPool there is an implicit assumption that the configured IPs are all v4. Specifically, the create() method is buggy for v6:

def create(self):
    if ':' in self.server:
        host, port = self.server.split(':')
    else:
        host = self.server
        port = DEFAULT_MEMCACHED_PORT
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
    with Timeout(self._connect_timeout):
        sock.connect((host, int(port)))
    return (sock.makefile(), sock)

The method should be rewritten to reason correctly about IPv6 addresses.

description: updated
Revision history for this message
Timur Alperovich (timur-alperovich) wrote :

Proposed a patch to fix this: https://review.openstack.org/#/c/258704/

Revision history for this message
Timur Alperovich (timur-alperovich) wrote :

Patch was merged and this is resolved.

Changed in swift:
status: New → Fix Released
assignee: nobody → Timur Alperovich (timur-alperovich)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.