[Freeipa-devel] [PATCHES 681-682] cert: speed up cert-find, do not crash on invalid data in cert-find

Jan Cholasta jcholast at redhat.com
Wed Aug 17 08:27:06 UTC 2016


On 16.8.2016 17:01, Martin Basti wrote:
>
>
> On 16.08.2016 17:00, Pavel Vomacka wrote:
>>
>>
>> On 08/12/2016 08:29 AM, Jan Cholasta wrote:
>>> On 11.8.2016 19:43, Martin Basti wrote:
>>>>
>>>>
>>>> On 11.08.2016 16:09, Jan Cholasta wrote:
>>>>> On 11.8.2016 14:27, Martin Basti wrote:
>>>>>>
>>>>>>
>>>>>> On 01.08.2016 10:27, Jan Cholasta wrote:
>>>>>>> On 1.8.2016 10:19, Jan Cholasta wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> the attached patches fix
>>>>>>>> <https://fedorahosted.org/freeipa/ticket/6098>
>>>>>>>> and <https://fedorahosted.org/freeipa/ticket/6150>.
>>>>>>>
>>>>>>> Self-NACK, proper patches attached.
>>>>>>>
>>>>>>> Honza
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> IMHO this is caused by your patches, test_cert_plugin.py:
>>>>>
>>>>> Fixed.
>>>>>
>>>>> Updated and rebased patches attached.
>>>>>
>>>> Hello,
>>>>
>>>> It works for me, but:
>>>>
>>>> 1)
>>>> Is this py2/3 compatible?
>>>> ra_obj = ra.get_certificate(str(serial_number))
>>>
>>> I don't see why not. Do you have any particular incompatibility in mind?
>>>
>>>>
>>>> 2)
>>>> Are you sure you need tuple() here?
>>>> +                for key in tuple(six.iterkeys(result)):
>>>
>>> Yes, I'm modifying `result` inside the loop.
>>>
>>> I don't need the six.iterkeys() though.
>>>
>>>>
>>>> 3)
>>>>       if cert is not None:
>>>>             filter = ldap.make_filter_from_attr('usercertificate',
>>>> value)
>>>>             filters.append(filter)
>>>>
>>>> Variable "value" may be referenced before assignment
>>>
>>> Right, it should be `cert`, not `value`.
>>>
>>>>
>>>> I haven't tested performace improvements yet, and it is quite big
>>>> change
>>>> so I will continue with testing tomorrow.
>> I tested performance improvements and cert-find in webui with 71
>> certificates took about 10 seconds before these patches, now it is
>> about 400ms (even with more certs) . So works for me perfectly. From
>> CLI it took about 10 seconds now around 4 seconds.
>
> Please fix reported issues by me, and we can push it.

Here you go.

-- 
Jan Cholasta
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-jcholast-681.3-cert-speed-up-cert-find.patch
Type: text/x-patch
Size: 18415 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160817/0efbaba7/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-jcholast-682.3-cert-do-not-crash-on-invalid-data-in-cert-find.patch
Type: text/x-patch
Size: 2598 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160817/0efbaba7/attachment-0001.bin>


More information about the Freeipa-devel mailing list