[SSSD] [PATCH] Make subdomain discovery less noisy

Sumit Bose sbose at redhat.com
Mon Sep 24 14:25:10 UTC 2012


On Mon, Sep 24, 2012 at 01:03:44PM +0200, Jakub Hrozek wrote:
> On Mon, Sep 24, 2012 at 12:41:07PM +0200, Pavel Březina wrote:
> > On 09/21/2012 06:42 PM, Sumit Bose wrote:
> > >On Fri, Sep 21, 2012 at 11:06:28AM +0200, Pavel Březina wrote:
> > >>On 09/20/2012 09:16 PM, Sumit Bose wrote:
> > >>>Hi,
> > >>>
> > >>>this patch fixeshttps://fedorahosted.org/sssd/ticket/1517  by increasing
> > >>>some of the debug levels and print a log messages about the actual
> > >>>request only if the subdomain provider is configured.
> > >>>
> > >>>bye,
> > >>>Sumit
> > >>>-        DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n",
> > >>>+        DEBUG(SSSDBG_TRACE_ALL, ("Request processed. Returned %d,%d,%s\n",
> > >>>                err_maj, err_min, err_msg));
> > >>>
> > >>>          /* send reply back */
> > >>>-- 1.7.7.6
> > >>
> > >>Hi,
> > >>in general the patch looks good to me. But I don't think that
> > >>TRACE_ALL is a good debug level for every possible error (most
> > >>configurations are not set with this level and for example
> > >>DP_ERR_OFFLINE should be visible in normal configurations).
> > >
> > >What would you suggest, shall I switch it back to SSSDBG_TRACE_LIBS?
> > 
> > Sorry, I should have been more clear. Can you make the debug level
> > conditional please? Use the higher level if the subdomains target is
> > not configured and the lower level otherwise.
> 
> If the conditional would be too ugly then I would just stick with
> TRACE_ALL. The reason for failure such as going offline would be
> visible in the logs earlier anyway.

New patch with condition added.

bye,
Sumit
-------------- next part --------------
From c94644cf858bb91060604817b445b3b96f6273fe Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Thu, 20 Sep 2012 20:16:28 +0200
Subject: [PATCH] Make subdomain discovery less noisy

Fixes https://fedorahosted.org/sssd/ticket/1517
---
 src/providers/data_provider_be.c |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index dcc40c73d72d3509437aaa7ad29c53a87dde4f8b..4e4bdab28fbaac6d251ca73bb143e46b8fb9753c 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -402,13 +402,22 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn)
         return EIO;
     }
 
+    reply = dbus_message_new_method_return(message);
+    if (!reply) return ENOMEM;
+
+    /* return an error if corresponding backend target is not configured */
+    if (becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops == NULL) {
+        DEBUG(SSSDBG_TRACE_INTERNAL, ("Undefined backend target.\n"));
+        err_maj = DP_ERR_FATAL;
+        err_min = ENODEV;
+        err_msg = "Subdomains back end target is not configured";
+        goto immediate;
+    }
+
     DEBUG(SSSDBG_TRACE_FUNC,
           ("Got get subdomains [%sforced][%s]\n", force ? "" : "not ",
           domain_hint == NULL ? "no hint": domain_hint ));
 
-    reply = dbus_message_new_method_return(message);
-    if (!reply) return ENOMEM;
-
     /* If we are offline return immediately
      */
     if (becli->bectx->offstat.offline) {
@@ -450,16 +459,6 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn)
 
     be_req->req_data = req;
 
-    /* return an error if corresponding backend target is not configured */
-    if (becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops == NULL) {
-        DEBUG(SSSDBG_CONF_SETTINGS, ("Undefined backend target.\n"));
-        err_maj = DP_ERR_FATAL;
-        err_min = ENODEV;
-        err_msg = "Subdomains back end target is not configured";
-        goto immediate;
-    }
-
-
     ret = be_file_request(becli->bectx,
                           be_req,
                           becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops->handler);
@@ -489,8 +488,10 @@ immediate:
             return EIO;
         }
 
-        DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n",
-              err_maj, err_min, err_msg));
+        if (!(err_maj == DP_ERR_FATAL && err_min == ENODEV)) {
+            DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n",
+                  err_maj, err_min, err_msg));
+        }
 
         /* send reply back */
         sbus_conn_send_reply(conn, reply);
-- 
1.7.7.6



More information about the sssd-devel mailing list