cinder-api ran into hang loop in python2.6
#cinder-api
...
...
snip...
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.AttributeError'> ignored
Exception AttributeError: "'GreenSocket' object has no attribute 'fd'" in <bound method GreenSocket.__del__ of <eventlet.greenio.GreenSocket object at 0x4e052d0>> ignored
...
...
snip...
> /usr/lib/ python2. 6/site- packages/ cinder/ wsgi.py( 178)__init_ _() getsockname( )[0:2] _("%(name) s listening on %(_host) s:%(_port) s") openstack. common. log.ContextAdap ter instance at 0x3755e18>, 'app': {(None, ''): <cinder. api.middleware. fault.FaultWrap per object at 0x50d1390>, (None, '/v1'): <cinder. openstack. common. middleware. request_ id.RequestIdMid dleware object at 0x50d0c50>, (None, '/v2'): <cinder. openstack. common. middleware. request_ id.RequestIdMid dleware object at 0x4de8ed0>}, '_socket': <eventlet. greenio. GreenSocket object at 0x3760790>, '_pool': <eventlet. greenpool. GreenPool object at 0x3754f10>, '_port': 8776, '_wsgi_logger': <cinder. openstack. common. log.WritableLog ger object at 0x3754f90>, '_protocol': <class eventlet. wsgi.HttpProtoc ol at 0x3355ef0>, '_host': '0.0.0.0', '_server': None, 'pool_size': 1000} AttributeError' > ignored
(Pdb) l
173 "after trying for 30 seconds") %
174 {'host': host, 'port': port})
175
176 (self._host, self._port) = self._socket.
177 import pdb;pdb.set_trace()
178 -> LOG.info(
179 % self.__dict__)
180
181 def start(self):
182 """Start serving a WSGI application.
183
(Pdb) self.__dict__
{'_use_ssl': None, 'name': 'osapi_volume', '_logger': <cinder.
(Pdb) c
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.
....
Above LOG.info fucntion calls i18n message to deep copy each value in self.__dict__which includes a socket object.
> /usr/lib/ python2. 6/site- packages/ oslo/i18n/ _message. py(134) _sanitize_ mod_params( ) self.params, dict): self.params, dict): param(val) ) items() ) param(val) )
-> if isinstance(
(Pdb) l
129 params = (other,)
130 elif isinstance(other, dict):
131 # Merge the dictionaries
132 # Copy each item in case one does not support deep copy.
133 params = {}
134 if isinstance(
135 params.update((key, self._copy_
136 for key, val in self.params.
137 -> params.update((key, self._copy_
138 for key, val in other.items())
139 else:
(Pdb)
In python2.6 copy.deepcopy() a sokect object will raise "Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions. AttributeError' > ignored", this causes the hang loop of cinder-api.
But in python2.7, it does not have any errors.
we don't need pass self.__dict__ into the LOG function, use instance's properties directly could fix the problem.