Bug 12548 - ads_cached_connection_connect ends up calling get_dc_name twice causing additional work
Summary: ads_cached_connection_connect ends up calling get_dc_name twice causing addit...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.5.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 05:46 UTC by Matthieu Patou
Modified: 2017-02-01 06:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2017-02-01 05:46:17 UTC
In ads_cached_connection_connect is calling get_dc_name line 131 and then through  ads_connect get_dc_name is called one more time at line 491 (when ADS_AUTH_NO_BIND is not set in the flags) of hsource3/libads/ldap.c

On complicated setup get_dc_name can take lots of time (in tens of seconds) and calling twice in a row is a creating a performance penalty that could be improved.
Comment 1 Matthieu Patou 2017-02-01 06:16:00 UTC
Maybe in the ADS_STRUCT we can add a field to track when the last time get_dc_name was called and hopefully cache the results for sometime if it was successful.