Fix for issue 2575.
The problem is that there is a timeout when reading the monitoring informations
on the server and the code did not handle this properly.
I have made the method Utils.getMessage to handle properly the case when a Topol
ogyCacheException has not a Throwable cause. In addition to that the method ret
urns a specific message when a timeout occurs. Finally the timeout thresold has
been risen from 10 to 30 seconds to be able to read the topology.
| | |
| | | private Set<SuffixDescriptor> suffixes = new HashSet<SuffixDescriptor>(); |
| | | |
| | | private final boolean isMultiThreaded = true; |
| | | private final static int MULTITHREAD_TIMEOUT = 10000; |
| | | private final static int MULTITHREAD_TIMEOUT = 30000; |
| | | |
| | | private static final Logger LOG = |
| | | Logger.getLogger(TopologyCache.class.getName()); |
| | |
| | | import javax.naming.AuthenticationException; |
| | | import javax.naming.NamingException; |
| | | import javax.naming.NoPermissionException; |
| | | import javax.naming.TimeLimitExceededException; |
| | | import javax.naming.ldap.InitialLdapContext; |
| | | import javax.naming.ldap.LdapName; |
| | | |
| | |
| | | ldapUrl = getLdapUrl(serverProperties); |
| | | } |
| | | lastException = new TopologyCacheException( |
| | | TopologyCacheException.Type.TIMEOUT, null, trustManager, ldapUrl); |
| | | TopologyCacheException.Type.TIMEOUT, |
| | | new TimeLimitExceededException("Timeout reading server: "+ldapUrl), |
| | | trustManager, ldapUrl); |
| | | LOG.log(Level.WARNING, "Timeout reading server: "+ldapUrl); |
| | | } |
| | | super.interrupt(); |
| | |
| | | INFO_ERROR_CONFIGURING_REMOTE_GENERIC=An unexpected error occurred \ |
| | | configuring server %s.%nThe error is: %s |
| | | INFO_ERROR_CONNECTING_TO_LOCAL=An error occurred connecting to the server. |
| | | INFO_ERROR_CONNECTING_TIMEOUT=The connection with the server timed out. |
| | | INFO_ERROR_COPYING=An unexpected error occurred extracting file %s. |
| | | INFO_ERROR_COPYING_FILE=Error copying file %s to %s. |
| | | INFO_ERROR_COULD_NOT_CREATE_PARENT_DIR=Could not create parent directory %s. \ |
| | |
| | | buf.append(INFO_SERVER_ERROR.get(hostName)); |
| | | buf.append(" "); |
| | | } |
| | | if (te.getCause() instanceof NamingException) |
| | | if (te.getType() == TopologyCacheException.Type.TIMEOUT) |
| | | { |
| | | buf.append(INFO_ERROR_CONNECTING_TIMEOUT.get()); |
| | | } |
| | | else if (te.getCause() instanceof NamingException) |
| | | { |
| | | buf.append(getThrowableMsg(INFO_ERROR_CONNECTING_TO_LOCAL.get(), |
| | | te.getCause())); |
| | | } |
| | | else |
| | | { |
| | | LOG.log(Level.WARNING, "Unexpected error: "+te, te); |
| | | // This is unexpected. |
| | | buf.append(getThrowableMsg(INFO_BUG_MSG.get(), te.getCause())); |
| | | if (te.getCause() != null) |
| | | { |
| | | buf.append(getThrowableMsg(INFO_BUG_MSG.get(), te.getCause())); |
| | | } |
| | | else |
| | | { |
| | | buf.append(getThrowableMsg(INFO_BUG_MSG.get(), te)); |
| | | } |
| | | } |
| | | return buf.toMessage(); |
| | | } |