Red Hat Bugzilla – Bug 1305127
Swift Proxy Server Unable to Connect to memcached Over IPv6
Last modified: 2016-10-26 09:42:08 EDT
Cloned for OSP 8.
This seems to be caused by an IPv4-centric connection method in /usr/lib/python2.7/site-packages/swift/common/memcached.py
This seems to fix the issue:
119 def create(self):
120 if ']' in self.server:
121 # deconstruct ipv6 address in brackets
122 server_uri = self.server.strip("[").split("]")
123 host = server_uri
124 if len(server_uri) > 1:
125 port = server_uri.strip(":")
127 port = DEFAULT_MEMCACHED_PORT
128 elif ':' in self.server:
129 host, port = self.server.split(':')
131 host = self.server
132 port = DEFAULT_MEMCACHED_PORT
133 if ":" in host:
134 sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
136 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
137 sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
138 with Timeout(self._connect_timeout):
139 sock.connect((host, int(port)))
140 return (sock.makefile(), sock)
The upstream bug is https://bugs.launchpad.net/swift/+bug/1526570 . It has been handled in Mitaka by a series of patches:
- https://review.openstack.org/258704 Fix IPv6 handling in MemcacheConnPool.
- https://review.openstack.org/265482 fixups for ipv6 memcache_servers docs
- https://review.openstack.org/265465 Fail early if the memcache address is invalid.
- https://review.openstack.org/265501 Make _get_addr() method a function in utils.
On a quick test, they apply (almost) flawlessly to stable/liberty, so I think it would be feasible to backport them.
This is not blocker for 8.0 GA, will be fixed in the first async.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.