Skip to content

Commit

Permalink
Merge pull request #22 from fbelzunc/JENKINS-33213-v2
Browse files Browse the repository at this point in the history
[FIXED JENKINS-33213] TimeLimitExceededException produces "Automatic" group lookup strategy not to work correctly
  • Loading branch information
fbelzunc committed Mar 1, 2016
2 parents 0c908ff + 26ebb1a commit 663ae60
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -45,6 +45,7 @@

import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.TimeLimitExceededException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
Expand Down Expand Up @@ -442,6 +443,8 @@ private Set<GrantedAuthority> resolveGroups(String domainDN, String userDN, DirC
try {
found = chainGroupLookup(domainDN, userDN, context, groups);
duration = TimeUnit2.NANOSECONDS.toSeconds(System.nanoTime() - start);
} catch (TimeLimitExceededException e) {
LOGGER.log(Level.WARNING, "The LDAP request did not terminate within the specified time limit. AD will fall back to recursive lookup", e);
} catch (NamingException e) {
if (e.getMessage().contains("LDAP response read timed out")) {
LOGGER.log(Level.WARNING, "LDAP response read time out. AD will fall back to recursive lookup", e);
Expand Down

0 comments on commit 663ae60

Please sign in to comment.