ctdb-mutex: Rename recheck_time to recheck_interval
authorMartin Schwenke <martin@meltin.net>
Wed, 19 Jan 2022 01:09:07 +0000 (12:09 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 28 Jul 2022 10:09:34 +0000 (10:09 +0000)
There will be more timeouts so clarify the intent of this one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_mutex_fcntl_helper.c
ctdb/tests/INTEGRATION/simple/cluster.015.reclock_remove_lock.sh
ctdb/tests/INTEGRATION/simple/cluster.016.reclock_move_lock_dir.sh

index 149f595d0f0d8b58a1f47cef6d1315470526dd89..c8ed1b62c429e85678226b712775ee7baa22d830 100644 (file)
@@ -166,7 +166,7 @@ struct wait_for_lost_state {
        struct tevent_context *ev;
        const char *lock_file;
        ino_t inode;
-       unsigned long recheck_time;
+       unsigned long recheck_interval;
 };
 
 static void wait_for_lost_check(struct tevent_req *subreq);
@@ -175,7 +175,7 @@ static struct tevent_req *wait_for_lost_send(TALLOC_CTX *mem_ctx,
                                             struct tevent_context *ev,
                                             const char *lock_file,
                                             int fd,
-                                            unsigned long recheck_time)
+                                            unsigned long recheck_interval)
 {
        struct tevent_req *req, *subreq;
        struct wait_for_lost_state *state;
@@ -189,7 +189,7 @@ static struct tevent_req *wait_for_lost_send(TALLOC_CTX *mem_ctx,
 
        state->ev = ev;
        state->lock_file = lock_file;
-       state->recheck_time = recheck_time;
+       state->recheck_interval = recheck_interval;
 
        ret = fstat(fd, &sb);
        if (ret != 0) {
@@ -207,7 +207,7 @@ static struct tevent_req *wait_for_lost_send(TALLOC_CTX *mem_ctx,
        subreq = tevent_wakeup_send(
                        state,
                        ev,
-                       tevent_timeval_current_ofs(state->recheck_time, 0));
+                       tevent_timeval_current_ofs(state->recheck_interval, 0));
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
@@ -257,7 +257,7 @@ static void wait_for_lost_check(struct tevent_req *subreq)
        subreq = tevent_wakeup_send(
                        state,
                        state->ev,
-                       tevent_timeval_current_ofs(state->recheck_time, 0));
+                       tevent_timeval_current_ofs(state->recheck_interval, 0));
        if (tevent_req_nomem(subreq, req)) {
                return;
        }
@@ -288,7 +288,7 @@ static struct tevent_req *wait_for_exit_send(TALLOC_CTX *mem_ctx,
                                             pid_t ppid,
                                             const char *lock_file,
                                             int fd,
-                                            unsigned long recheck_time)
+                                            unsigned long recheck_interval)
 {
        struct tevent_req *req, *subreq;
        struct wait_for_exit_state *state;
@@ -304,12 +304,12 @@ static struct tevent_req *wait_for_exit_send(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(subreq, wait_for_exit_parent_done, req);
 
-       if (recheck_time > 0) {
+       if (recheck_interval > 0) {
                subreq = wait_for_lost_send(state,
                                            ev,
                                            lock_file,
                                            fd,
-                                           recheck_time);
+                                           recheck_interval);
                if (tevent_req_nomem(subreq, req)) {
                        return tevent_req_post(req, ev);
                }
@@ -372,7 +372,7 @@ static bool wait_for_exit_recv(struct tevent_req *req, int *perr)
 
 static void usage(void)
 {
-       fprintf(stderr, "Usage: %s <file> [recheck_time]\n", progname);
+       fprintf(stderr, "Usage: %s <file> [recheck_interval]\n", progname);
 }
 
 int main(int argc, char *argv[])
@@ -381,7 +381,7 @@ int main(int argc, char *argv[])
        char result;
        int ppid;
        const char *file = NULL;
-       unsigned long recheck_time;
+       unsigned long recheck_interval;
        int ret;
        int fd = -1;
        struct tevent_req *req;
@@ -405,13 +405,13 @@ int main(int argc, char *argv[])
 
        file = argv[1];
 
-       recheck_time = 5;
+       recheck_interval = 5;
        if (argc == 3) {
-               recheck_time = smb_strtoul(argv[2],
-                                          NULL,
-                                          10,
-                                          &ret,
-                                          SMB_STR_STANDARD);
+               recheck_interval = smb_strtoul(argv[2],
+                                              NULL,
+                                              10,
+                                              &ret,
+                                              SMB_STR_STANDARD);
                if (ret != 0) {
                        usage();
                        exit(1);
@@ -425,7 +425,7 @@ int main(int argc, char *argv[])
                return 0;
        }
 
-       req = wait_for_exit_send(ev, ev, ppid, file, fd, recheck_time);
+       req = wait_for_exit_send(ev, ev, ppid, file, fd, recheck_interval);
        if (req == NULL) {
                fprintf(stderr,
                        "%s: wait_for_exit_send() failed\n",
index 2283c30edbfdbd7a3243574f685570af28c62132..9088a800498e1cdf08fb38a49f14bb0796572825 100755 (executable)
@@ -10,7 +10,7 @@ ctdb_test_skip_on_cluster
 
 ctdb_test_init -n
 
-echo "Starting CTDB with cluster lock recheck time set to 5s..."
+echo "Starting CTDB with cluster lock recheck interval set to 5s..."
 ctdb_nodes_start_custom -r 5
 
 generation_has_changed ()
index ca2e7157dfcc2ca57dd2329603c3e2018ba69cfb..147547dd3ef87a13bdb1d3906a545bdc75b07ffa 100755 (executable)
@@ -16,7 +16,7 @@ ctdb_test_skip_on_cluster
 
 ctdb_test_init -n
 
-echo "Starting CTDB with cluster lock recheck time set to 5s..."
+echo "Starting CTDB with cluster lock recheck interval set to 5s..."
 ctdb_nodes_start_custom -r 5
 
 select_test_node