ctdb-daemon: Switch to using ETIMEDOUT instead of ETIME
authorAmitay Isaacs <amitay@gmail.com>
Tue, 10 Jul 2018 08:18:33 +0000 (18:18 +1000)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Jul 2018 01:50:10 +0000 (03:50 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdb_client.c
ctdb/server/ctdb_monitor.c
ctdb/server/ctdb_recover.c
ctdb/server/ctdb_takeover.c
ctdb/server/eventscript.c

index 67c89dee3d08b9f596f0d84e52252161e43b202f..98c61cb74520c90ec30a4cc6ba5ed0ea8e2ece2a 100644 (file)
@@ -1638,7 +1638,7 @@ static void async_callback(struct ctdb_client_control_state *state)
                }
                data->fail_count++;
                if (state->state == CTDB_CONTROL_TIMEOUT) {
-                       res = -ETIME;
+                       res = -ETIMEDOUT;
                } else {
                        res = -1;
                }
index 68884ac5c11a879b57641e4b14f7a02dcf2d30a6..cfa3a6a1bfa3df0ddbd9a0e2fec126dfa4912bdc 100644 (file)
@@ -134,7 +134,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
                goto after_change_status;
        }
 
-       if (status == ETIME) {
+       if (status == ETIMEDOUT) {
                ctdb->monitor->event_script_timeouts++;
 
                if (ctdb->monitor->event_script_timeouts >=
index f4cd5f64eee5821e1884a1c6743b93f3c2868a8f..fc64037b95f7ef4d0c6b902f276a1016ba3d2ca1 100644 (file)
@@ -1048,7 +1048,7 @@ static void ctdb_end_recovery_callback(struct ctdb_context *ctdb, int status, vo
 
        if (status != 0) {
                DEBUG(DEBUG_ERR,(__location__ " recovered event script failed (status %d)\n", status));
-               if (status == -ETIME) {
+               if (status == -ETIMEDOUT) {
                        ctdb_ban_self(ctdb);
                }
        }
index 95663afa1d9881680aaa5fa763095269ab2079a5..a7638cfd677bebd93d010ba5930d28a3d659190b 100644 (file)
@@ -466,7 +466,7 @@ static void ctdb_do_takeip_callback(struct ctdb_context *ctdb, int status,
        TDB_DATA data;
 
        if (status != 0) {
-               if (status == -ETIME) {
+               if (status == -ETIMEDOUT) {
                        ctdb_ban_self(ctdb);
                }
                DEBUG(DEBUG_ERR,(__location__ " Failed to takeover IP %s on interface %s\n",
@@ -587,7 +587,7 @@ static void ctdb_do_updateip_callback(struct ctdb_context *ctdb, int status,
                talloc_get_type(private_data, struct ctdb_do_updateip_state);
 
        if (status != 0) {
-               if (status == -ETIME) {
+               if (status == -ETIMEDOUT) {
                        ctdb_ban_self(ctdb);
                }
                DEBUG(DEBUG_ERR,
@@ -886,7 +886,7 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status,
        struct release_ip_callback_state *state =
                talloc_get_type(private_data, struct release_ip_callback_state);
 
-       if (status == -ETIME) {
+       if (status == -ETIMEDOUT) {
                ctdb_ban_self(ctdb);
        }
 
@@ -2270,7 +2270,7 @@ static void ctdb_ipreallocated_callback(struct ctdb_context *ctdb,
                DEBUG(DEBUG_ERR,
                      (" \"ipreallocated\" event script failed (status %d)\n",
                       status));
-               if (status == -ETIME) {
+               if (status == -ETIMEDOUT) {
                        ctdb_ban_self(ctdb);
                }
        }
index de05443e66ca0da14cb29a14af7425b695e625fd..4ef3b80706a8711561bd3d548474214c40e88282 100644 (file)
@@ -562,7 +562,7 @@ static void ctdb_event_script_run_done(int result, void *private_data)
        struct ctdb_event_script_run_state *state = talloc_get_type_abort(
                private_data, struct ctdb_event_script_run_state);
 
-       if (result == ETIME) {
+       if (result == ETIMEDOUT) {
                switch (state->event) {
                case CTDB_EVENT_START_RECOVERY:
                case CTDB_EVENT_RECOVERED:
@@ -716,7 +716,7 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_event call,
                tevent_loop_once(ctdb->ev);
        }
 
-       if (state.status == ETIME) {
+       if (state.status == ETIMEDOUT) {
                /* Don't ban self if CTDB is starting up or shutting down */
                if (call != CTDB_EVENT_INIT && call != CTDB_EVENT_SHUTDOWN) {
                        DEBUG(DEBUG_ERR,