mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
29.56.2013 96122d787f109fbd955f41a347b05588f4b31452
Partial fix for OPENDJ-1112: LoadBalancing connection factories need better diagnostic messages

* avoid accidentally trapping Errors - only RuntimeExceptions should be caught. Thanks to Peter for pointing this out :-)
1 files modified
12 ■■■■ changed files
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java 12 ●●●● patch | view | raw | blame | history
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/AbstractLoadBalancingAlgorithm.java
@@ -170,8 +170,8 @@
                synchronized (listenerLock) {
                    try {
                        listener.handleConnectionFactoryOffline(factory, error);
                    } catch (Throwable t) {
                        handleListenerException(t);
                    } catch (RuntimeException e) {
                        handleListenerException(e);
                    }
                }
@@ -197,8 +197,8 @@
                synchronized (listenerLock) {
                    try {
                        listener.handleConnectionFactoryOnline(factory);
                    } catch (Throwable t) {
                        handleListenerException(t);
                    } catch (RuntimeException e) {
                        handleListenerException(e);
                    }
                }
@@ -216,10 +216,10 @@
            }
        }
        private void handleListenerException(Throwable t) {
        private void handleListenerException(RuntimeException e) {
            if (DEBUG_LOG.isLoggable(Level.SEVERE)) {
                DEBUG_LOG.log(Level.SEVERE,
                        "A run-time error occurred while processing a load-balancer event", t);
                        "A run-time error occurred while processing a load-balancer event", e);
            }
        }
    }