[java-identity-provider] branch main updated: IDP-1760 - Improve logging on redundant connectors

Scott Cantor cantor.2 at osu.edu
Fri Feb 26 00:38:49 UTC 2021


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=c26f60315b16522251216d45b404aeaf3e9bcd99

The following commit(s) were added to refs/heads/main by this push:
       new  c26f60315 IDP-1760 - Improve logging on redundant connectors
c26f60315 is described below

commit c26f60315b16522251216d45b404aeaf3e9bcd99
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Feb 25 19:38:44 2021 -0500

    IDP-1760 - Improve logging on redundant connectors
    
    https://issues.shibboleth.net/jira/browse/IDP-1760
---
 .../resolver/impl/AttributeResolverImpl.java          | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
index 487e9c106..53d630084 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
@@ -49,6 +49,7 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
 import net.shibboleth.idp.attribute.resolver.AttributeDefinition;
 import net.shibboleth.idp.attribute.resolver.AttributeResolver;
 import net.shibboleth.idp.attribute.resolver.DataConnector;
+import net.shibboleth.idp.attribute.resolver.NoResultAnErrorResolutionException;
 import net.shibboleth.idp.attribute.resolver.ResolutionException;
 import net.shibboleth.idp.attribute.resolver.ResolvedAttributeDefinition;
 import net.shibboleth.idp.attribute.resolver.ResolvedDataConnector;
@@ -339,6 +340,7 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
         workContext.recordAttributeDefinitionResolution(definition, resolvedAttribute);
     }
 
+// Checkstyle: CyclomaticComplexity|MethodLength OFF
     /**
      * Resolve the {@link DataConnector} which has the specified ID.
      * 
@@ -382,9 +384,9 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
                 return;
             }
             if (connector.isPropagateResolutionExceptions()) {
-                throw new ResolutionException("Previous resolve failed");
+                throw new ResolutionException("Connector in no-retry state from previous failure");
             }
-            log.warn("Data connector '{}' previously failed but was configured not to propagate");
+            log.debug("Data connector '{}' in no-retry state, not configured to propagate failure");
             return;
         }
 
@@ -396,14 +398,20 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
         } catch (final ResolutionException e) {
             final String failoverDataConnectorId = connector.getFailoverDataConnectorId();
             if (null != failoverDataConnectorId) {
-                log.debug("{} Data connector '{}' failed to resolve, invoking failover data"
-                        + " connector '{}'.  Reason for failure:", logPrefix, connectorId, failoverDataConnectorId, e);
+                if (e instanceof NoResultAnErrorResolutionException) {
+                    log.debug("{} Data connector '{}' returned no result, invoking failover connector '{}'", logPrefix,
+                            connectorId, failoverDataConnectorId, e);
+                } else {
+                    log.warn("{} Data connector '{}' failed, invoking failover connector '{}'", logPrefix, connectorId,
+                            failoverDataConnectorId, e);
+                }
                 resolveDataConnector(failoverDataConnectorId, resolutionContext);
                 workContext.recordFailoverResolution(connector, dataConnectors.get(failoverDataConnectorId));
                 return;
             }
             // Pass it on. Do not look at propagateException because this is handled in the
             // connector code logic.
+            log.warn("{} Data connector '{}' failed", logPrefix, connectorId, e);
             throw e;
         }
 
@@ -415,7 +423,8 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
         }
         workContext.recordDataConnectorResolution(connector, resolvedAttributes);
     }
-
+// Checkstyle: CyclomaticComplexity|MethodLength ON
+    
     /**
      * Resolves all the dependencies for a given plugin.
      * 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list