Skip to content

Commit

Permalink
Add logging of stack trace to help debugging AuthN problems and for c…
Browse files Browse the repository at this point in the history
…onsistency with the classes they are in (apache#7987)
  • Loading branch information
kellyfj authored Sep 14, 2020
1 parent be35d81 commit 3c278fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private void createDefaultNameSpace(String cluster) {
admin.namespaces().setNamespaceReplicationClusters(defaultNamespace, Sets.newHashSet(config.getClusterName()));
}
} catch (PulsarAdminException e) {
log.info(e.getMessage());
log.info(e.getMessage(), e);
}
}

Expand Down Expand Up @@ -413,7 +413,7 @@ private void createSampleNameSpace(ClusterData clusterData, String cluster) {
admin.namespaces().createNamespace(namespace);
}
} catch (PulsarAdminException e) {
log.info(e.getMessage());
log.warn(e.getMessage(), e);
}
}

Expand Down Expand Up @@ -447,7 +447,7 @@ public void close() {
bkEnsemble.stop();
}
} catch (Exception e) {
log.error("Shutdown failed: {}", e.getMessage());
log.error("Shutdown failed: {}", e.getMessage(), e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ protected void validatePartitionedTopicMetadata(String tenant, String namespace,
throw new RestException(Status.CONFLICT, "Topic is not partitioned topic");
}
} catch ( InterruptedException | ExecutionException e) {
log.error("Failed to validate partitioned topic metadata {}://{}/{}/{}", domain(), tenant, namespace, topicName, e);
throw new RestException(Status.INTERNAL_SERVER_ERROR, "Check topic partition meta failed.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ protected void validateSuperUserAccess() {
appId, originalPrincipal));
}
} catch (InterruptedException | ExecutionException e) {
log.error("Error validating super-user access : "+ e.getMessage(), e);
throw new RestException(Status.INTERNAL_SERVER_ERROR, e.getMessage());
}
log.debug("Successfully authorized {} (proxied by {}) as super-user",
Expand Down Expand Up @@ -342,7 +343,6 @@ protected void validateClusterOwnership(String cluster) throws WebApplicationExc
// redirect to the cluster requested
if (log.isDebugEnabled()) {
log.debug("[{}] Redirecting the rest call to {}: cluster={}", clientAppId(), redirect, cluster);

}
throw new WebApplicationException(Response.temporaryRedirect(redirect).build());
}
Expand Down

0 comments on commit 3c278fb

Please sign in to comment.