[Freeipa-devel] [PATCH] 1065 Close connection after each request

Rob Crittenden rcritten at redhat.com
Wed Oct 24 19:09:08 UTC 2012


Martin Kosek wrote:
> On 10/23/2012 04:52 PM, Rob Crittenden wrote:
>> Close connection after each request, avoid NSS shutdown problem.
>>
>> The unit tests were failing when executed against an Apache server
>> in F-18 due to dangling references causing NSS shutdown to fail, and
>> potentially other places like adding host keys during client enrollment.
>>
>> rob
>>
>
> This works very well in Fedora 18 (Python 2.7.3), but cause crashes with Python
> 2.6.x:
>
> # ./make-testcert
> ipa: ERROR: non-public: AttributeError: KerbTransport instance has no attribute
> '_connection'
> Traceback (most recent call last):
>    File "/root/freeipa-master/ipalib/backend.py", line 129, in execute
>      result = self.Command[_name](*args, **options)
>    File "/root/freeipa-master/ipalib/frontend.py", line 435, in __call__
>      ret = self.run(*args, **options)
>    File "/root/freeipa-master/ipalib/frontend.py", line 748, in run
>      return self.forward(*args, **options)
>    File "/root/freeipa-master/ipalib/frontend.py", line 769, in forward
>      return self.Backend.xmlclient.forward(self.name, *args, **kw)
>    File "/root/freeipa-master/ipalib/rpc.py", line 538, in forward
>      response = command(*xml_wrap(params))
>    File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
>      return self.__send(self.__name, args)
>    File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
>      verbose=self.__verbose
>    File "/usr/lib64/python2.6/xmlrpclib.py", line 1228, in request
>      h = self.make_connection(host)
>    File "/root/freeipa-master/ipalib/rpc.py", line 261, in make_connection
>      if self._connection and host == self._connection[0]:
> AttributeError: KerbTransport instance has no attribute '_connection'
> Traceback (most recent call last):
>    File "./make-testcert", line 134, in <module>
>      sys.exit(makecert(reqdir))
>    File "./make-testcert", line 101, in makecert
>      res = api.Backend.client.run('config_show')
>    File "./make-testcert", line 68, in run
>      result = self.execute(method, *args, **options)
>    File "/root/freeipa-master/ipalib/backend.py", line 142, in execute
>      destroy_context()
>    File "/root/freeipa-master/ipalib/request.py", line 56, in destroy_context
>      value.disconnect()
>    File "/root/freeipa-master/ipalib/backend.py", line 78, in disconnect
>      self.destroy_connection()
>    File "/root/freeipa-master/ipalib/rpc.py", line 516, in destroy_connection
>      conn.close()
> AttributeError: KerbTransport instance has no attribute 'close'
>
>
> Attaching a diff that made it working for me on Python 2.6.x.
>
> Martin
>

Rolled your changes in and re-tested in in both Python 2.6 and 2.7. 
Works for me.

pushed to master and ipa-3-0

rob




More information about the Freeipa-devel mailing list