Bug 50643 - ADC memory leak in group member cache
ADC memory leak in group member cache
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: AD Connector
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-3-errata
Assigned To: Arvid Requate
Erik Damrose
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-12-16 17:00 CET by Arvid Requate
Modified: 2020-01-22 14:47 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019121321000192
Bug group (optional):
Max CVSS v3 score:


Attachments
fix_adc_memory_leak_in_group_member_cache.patch (4.70 KB, patch)
2019-12-16 17:00 CET, Arvid Requate
Details | Diff
QA proposal for fix (1.58 KB, patch)
2020-01-13 15:45 CET, Erik Damrose
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2019-12-16 17:00:57 CET
Created attachment 10272 [details]
fix_adc_memory_leak_in_group_member_cache.patch

Ticket #2019121321000192 reported AD-Connector consuming memory until OOM.

From reading the code I think the ad().group_members_cache_* could be growing indefinitely, see attached patch.
Comment 1 Arvid Requate univentionstaff 2019-12-19 13:26:40 CET
699cc88288 | Turn self.group_members_cache_* into a set()
9bf26d8471 | Advisory
Comment 2 Erik Damrose univentionstaff 2020-01-13 15:45:06 CET
Created attachment 10282 [details]
QA proposal for fix

OK: Migrate to set, probably adapted patch from #50644
Reopen: At least one occurence of the old list handling was missing, which caused the ad connector to fail on initialization:

connector-status.log

 --- connect failed, failure was: ---
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/connector/ad/main.py", line 302, in main
    connect()
  File "/usr/lib/python2.7/dist-packages/univention/connector/ad/main.py", line 190, in connect
    baseConfig['%s/ad/listener/dir' % CONFIGBASENAME]
  File "/usr/lib/python2.7/dist-packages/univention/connector/ad/__init__.py", line 908, in __init__
    self.group_members_cache_con[group].extend(m.lower() for m in ad_members)
AttributeError: 'set' object has no attribute 'extend'

I found one wrong syntax line in a debug output. A patch proposal is attached.
Comment 3 Arvid Requate univentionstaff 2020-01-14 11:40:33 CET
Oh, how embarrassing, sorry.

533a750e84 | Feedback from QA
781c441283 | Advisory

Package: univention-ad-connector
Version: 13.0.0-20A~4.4.0.202001141138
Branch: ucs_4.4-0
Scope: errata4.4-3
Comment 4 Erik Damrose univentionstaff 2020-01-14 17:05:32 CET
OK: Patch applied
OK: yaml
Waiting for automated test results
Comment 5 Erik Damrose univentionstaff 2020-01-17 16:33:34 CET
OK: ucs-test, manual tests
Verified
Comment 6 Erik Damrose univentionstaff 2020-01-22 14:47:58 CET
<http://errata.software-univention.de/ucs/4.4/425.html>