client: async_callback() sets result to -ETIME if a control times out
authorMartin Schwenke <martin@meltin.net>
Thu, 23 May 2013 06:09:38 +0000 (16:09 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 24 May 2013 06:04:56 +0000 (16:04 +1000)
Otherwise there is no way of treating a timeout differently to a
general failure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

client/ctdb_client.c

index 665426cd9230d75f2aaf4572f128b575f44cf509..334d830707d3a3ad79e899e2f320d1537c9eff33 100644 (file)
@@ -3329,6 +3329,11 @@ static void async_callback(struct ctdb_client_control_state *state)
                        DEBUG(DEBUG_ERR,("Async operation failed with state %d, opcode:%u\n", state->state, data->opcode));
                }
                data->fail_count++;
+               if (state->state == CTDB_CONTROL_TIMEOUT) {
+                       res = -ETIME;
+               } else {
+                       res = -1;
+               }
                if (data->fail_callback) {
                        data->fail_callback(ctdb, destnode, res, outdata,
                                        data->callback_data);