You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/21 19:11:34 UTC

brooklyn-server git commit: suppress warnings on utrace

Repository: brooklyn-server
Updated Branches:
  refs/heads/master f618e6be4 -> 450a0021d


suppress warnings on utrace


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/450a0021
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/450a0021
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/450a0021

Branch: refs/heads/master
Commit: 450a0021d4dfe61d214f73eb26b094824e2325de
Parents: f618e6b
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sun Feb 21 10:11:18 2016 -0800
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sun Feb 21 10:11:18 2016 -0800

----------------------------------------------------------------------
 .../brooklyn/core/location/geo/UtraceHostGeoLookup.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/450a0021/core/src/main/java/org/apache/brooklyn/core/location/geo/UtraceHostGeoLookup.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/geo/UtraceHostGeoLookup.java b/core/src/main/java/org/apache/brooklyn/core/location/geo/UtraceHostGeoLookup.java
index 5026ac4..1ff8a3e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/geo/UtraceHostGeoLookup.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/geo/UtraceHostGeoLookup.java
@@ -121,6 +121,8 @@ Beyond this you get blacklisted and requests may time out, or return none.
         return getHostGeoInfo(address, REQUEST_TIMEOUT);
     }
     
+    private static boolean loggedInternetIssues = false;
+    
     /** does a {@link #retrieveHostGeoInfo(InetAddress)} with a timeout (returning null, interrupting, and setting failure time) */
     public HostGeoInfo getHostGeoInfo(final InetAddress address, Duration timeout) throws MalformedURLException, IOException {
         final AtomicReference<HostGeoInfo> result = new AtomicReference<HostGeoInfo>();
@@ -129,8 +131,14 @@ Beyond this you get blacklisted and requests may time out, or return none.
                 try {
                     result.set(retrieveHostGeoInfo(address));
                 } catch (Exception e) {
-                    log.warn("Error computing geo info for "+address+"; internet issues or too many requests to (free) servers for "+JavaClassNames.simpleClassName(UtraceHostGeoLookup.this)+": "+e);
-                    log.debug("Detail of host geo error: "+e, e);
+                    Exceptions.propagateIfFatal(e);
+                    if (loggedInternetIssues) {
+                        log.debug("Error computing geo info for "+address+"; internet issues or too many requests to (free) servers for "+JavaClassNames.simpleClassName(UtraceHostGeoLookup.this)+" (see previous WARN message for detail): "+e);
+                    } else {
+                        loggedInternetIssues = true;
+                        log.warn("Error computing geo info for "+address+"; internet issues or too many requests to (free) servers for "+JavaClassNames.simpleClassName(UtraceHostGeoLookup.this)+" (subsequent errors at debug): "+e);
+                        log.debug("Detail of host geo error: "+e, e);
+                    }
                 }
             }
         };