Yair Zaslavsky has uploaded a new change for review. Change subject: [WIP] core: setting proper timeout mechanism for GetRootDSE (#844733) ......................................................................
[WIP] core: setting proper timeout mechanism for GetRootDSE (#844733) https://bugzilla.redhat.com/844733 This is a first patch in series of patches that deals with a problem that search users reaches a timeout. In this patch, a proper timeout mechanism is used. Although it was assumed that changing LdapQueryTimeout to a low value (i.e - 3 seconds) will yield a timeout after the provided amount of time, in fact it took longer for GetRootDSE to timeout. This patch fixes this issue. Change-Id: I59e875997b904cbdc058a45efd640f5bf1fc6579 Signed-off-by: Yair Zaslavsky <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/GetRootDSE.java 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/79/7479/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/GetRootDSE.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/GetRootDSE.java index e8c0e36..751e04b 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/GetRootDSE.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/GetRootDSE.java @@ -39,6 +39,8 @@ */ private void execute(LdapProviderType ldapProviderType, String domain) { Hashtable<String, String> env = new Hashtable<String, String>(); + int timeLimit = Config.<Integer> GetValue(ConfigValues.LDAPQueryTimeout) * 1000; + env.put("com.sun.jndi.ldap.connect.timeout", Long.toString(timeLimit)); initContextVariables(env); Attributes results = null; @@ -58,7 +60,7 @@ searchControls.setSearchScope(queryExecution.getSearchScope()); // Added this in order to prevent a warning saying: "the returning obj flag wasn't set, setting it to true" searchControls.setReturningObjFlag(true); - searchControls.setTimeLimit(Config.<Integer> GetValue(ConfigValues.LDAPQueryTimeout) * 1000); + searchControls.setTimeLimit(timeLimit); NamingEnumeration<SearchResult> search = ctx.search(queryExecution.getBaseDN(), queryExecution.getFilter(), searchControls); -- To view, visit http://gerrit.ovirt.org/7479 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59e875997b904cbdc058a45efd640f5bf1fc6579 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
