The branch, master has been updated
       via  28fad1c ctdb-daemon: Log a message when vfork() takes long time
       via  0617196 ctdb-daemon: Log a message when fork() takes long time
       via  a69d1e2 ctdb-daemon: Avoid extra condition in tevent trace callback
       via  6b93b57 ctdb-recovery-helper: Add missing initialisation of 
ban_credits
      from  085542f lib: poll_funcs : poll_funcs_context_slot_find can select 
the wrong slot to replace.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 28fad1c59de6fb1e70d4c0875b1588493fb901d1
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Thu Sep 15 16:10:49 2016 +1000

    ctdb-daemon: Log a message when vfork() takes long time
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>
    Reviewed-by: Martin Schwenke <mar...@meltin.net>
    
    Autobuild-User(master): Martin Schwenke <mart...@samba.org>
    Autobuild-Date(master): Mon Sep 19 12:18:15 CEST 2016 on sn-devel-144

commit 06171961d63d20d3485866bd99d940286f4b25a3
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Thu Sep 15 16:10:49 2016 +1000

    ctdb-daemon: Log a message when fork() takes long time
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>
    Reviewed-by: Martin Schwenke <mar...@meltin.net>

commit a69d1e202a6d8a461bbab0889cc39d86b870c057
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Fri Mar 27 16:23:48 2015 +1100

    ctdb-daemon: Avoid extra condition in tevent trace callback
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>
    Reviewed-by: Martin Schwenke <mar...@meltin.net>

commit 6b93b57921fad40cb3601888154c2f73a75fd590
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Mon Sep 19 14:59:06 2016 +1000

    ctdb-recovery-helper: Add missing initialisation of ban_credits
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12275
    
    Signed-off-by: Amitay Isaacs <ami...@gmail.com>
    Reviewed-by: Martin Schwenke <mar...@meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_daemon.c          | 35 +++++++++++++++++++++--------------
 ctdb/server/ctdb_fork.c            | 10 ++++++++++
 ctdb/server/ctdb_logging.c         | 10 ++++++++++
 ctdb/server/ctdb_recovery_helper.c |  1 +
 4 files changed, 42 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index 47e49df..a1579f9 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -1103,6 +1103,16 @@ static void ctdb_setup_event_callback(struct 
ctdb_context *ctdb, int status,
 static struct timeval tevent_before_wait_ts;
 static struct timeval tevent_after_wait_ts;
 
+static void ctdb_tevent_trace_init(void)
+{
+       struct timeval now;
+
+       now = timeval_current();
+
+       tevent_before_wait_ts = now;
+       tevent_after_wait_ts = now;
+}
+
 static void ctdb_tevent_trace(enum tevent_trace_point tp,
                              void *private_data)
 {
@@ -1119,25 +1129,21 @@ static void ctdb_tevent_trace(enum tevent_trace_point 
tp,
 
        switch (tp) {
        case TEVENT_TRACE_BEFORE_WAIT:
-               if (!timeval_is_zero(&tevent_after_wait_ts)) {
-                       diff = timeval_until(&tevent_after_wait_ts, &now);
-                       if (diff.tv_sec > 3) {
-                               DEBUG(DEBUG_ERR,
-                                     ("Handling event took %ld seconds!\n",
-                                      (long)diff.tv_sec));
-                       }
+               diff = timeval_until(&tevent_after_wait_ts, &now);
+               if (diff.tv_sec > 3) {
+                       DEBUG(DEBUG_ERR,
+                             ("Handling event took %ld seconds!\n",
+                              diff.tv_sec));
                }
                tevent_before_wait_ts = now;
                break;
 
        case TEVENT_TRACE_AFTER_WAIT:
-               if (!timeval_is_zero(&tevent_before_wait_ts)) {
-                       diff = timeval_until(&tevent_before_wait_ts, &now);
-                       if (diff.tv_sec > 3) {
-                               DEBUG(DEBUG_CRIT,
-                                     ("No event for %ld seconds!\n",
-                                      (long)diff.tv_sec));
-                       }
+               diff = timeval_until(&tevent_before_wait_ts, &now);
+               if (diff.tv_sec > 3) {
+                       DEBUG(DEBUG_ERR,
+                             ("No event for %ld seconds!\n",
+                              diff.tv_sec));
                }
                tevent_after_wait_ts = now;
                break;
@@ -1287,6 +1293,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool 
do_fork)
                exit(1);
        }
        tevent_loop_allow_nesting(ctdb->ev);
+       ctdb_tevent_trace_init();
        tevent_set_trace_callback(ctdb->ev, ctdb_tevent_trace, ctdb);
        ret = ctdb_init_tevent_logging(ctdb);
        if (ret != 0) {
diff --git a/ctdb/server/ctdb_fork.c b/ctdb/server/ctdb_fork.c
index 4edbe88..54ffd02 100644
--- a/ctdb/server/ctdb_fork.c
+++ b/ctdb/server/ctdb_fork.c
@@ -25,6 +25,7 @@
 #include <tevent.h>
 
 #include "lib/util/debug.h"
+#include "lib/util/time.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
@@ -68,6 +69,10 @@ void ctdb_track_child(struct ctdb_context *ctdb, pid_t pid)
 pid_t ctdb_fork(struct ctdb_context *ctdb)
 {
        pid_t pid;
+       struct timeval before;
+       double delta_t;
+
+       before = timeval_current();
 
        pid = fork();
        if (pid == -1) {
@@ -104,6 +109,11 @@ pid_t ctdb_fork(struct ctdb_context *ctdb)
                return 0;
        }
 
+       delta_t = timeval_elapsed(&before);
+       if (delta_t > 3.0) {
+               DEBUG(DEBUG_WARNING, ("fork() took %lf seconds\n", delta_t));
+       }
+
        ctdb_track_child(ctdb, pid);
        return pid;
 }
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 692df73..fbafe9b 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -29,6 +29,7 @@
 #include "lib/util/dlinklist.h"
 #include "lib/util/debug.h"
 #include "lib/util/blocking.h"
+#include "lib/util/time.h"
 
 #include "ctdb_private.h"
 #include "ctdb_client.h"
@@ -200,6 +201,8 @@ struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX 
*mem_ctx,
        struct tevent_fd *fde;
        char **argv;
        int i;
+       struct timeval before;
+       double delta_t;
 
        log = talloc_zero(mem_ctx, struct ctdb_log_state);
        CTDB_NO_MEMORY_NULL(ctdb, log);
@@ -230,6 +233,8 @@ struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX 
*mem_ctx,
                argv[i+2] = discard_const(helper_argv[i]);
        }
 
+       before = timeval_current();
+
        *pid = vfork();
        if (*pid == 0) {
                execv(helper, argv);
@@ -243,6 +248,11 @@ struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX 
*mem_ctx,
                goto free_log;
        }
 
+       delta_t = timeval_elapsed(&before);
+       if (delta_t > 3.0) {
+               DEBUG(DEBUG_WARNING, ("vfork() took %lf seconds\n", delta_t));
+       }
+
        ctdb_track_child(ctdb, *pid);
 
        log->pfd = p[0];
diff --git a/ctdb/server/ctdb_recovery_helper.c 
b/ctdb/server/ctdb_recovery_helper.c
index 9e142cd..4e4a986 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -1400,6 +1400,7 @@ static struct tevent_req *collect_all_db_send(
        state->pnn_list = pnn_list;
        state->count = count;
        state->caps = caps;
+       state->ban_credits = ban_credits;
        state->db_id = db_id;
        state->recdb = recdb;
        state->index = 0;


-- 
Samba Shared Repository

Reply via email to