1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

libctdb: synchronous should be using ctdb_cancel to kill unfinished requests.

Found by ctdb-test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


(This used to be ctdb commit cd6b2f46075bfb64561496960af7fc2e95500e52)
This commit is contained in:
Rusty Russell 2010-06-18 15:15:27 +09:30
parent b72620814c
commit 8e82448a5a

View File

@ -41,12 +41,16 @@ static struct ctdb_request *synchronous(struct ctdb_connection *ctdb,
/* Signalled is OK, other error is bad. */ /* Signalled is OK, other error is bad. */
if (errno == EINTR) if (errno == EINTR)
continue; continue;
ctdb_request_free(ctdb, req); ctdb_cancel(ctdb, req);
DEBUG(ctdb, LOG_ERR, "ctdb_synchronous: poll failed"); DEBUG(ctdb, LOG_ERR, "ctdb_synchronous: poll failed");
return NULL; return NULL;
} }
if (ctdb_service(ctdb, fds.revents) < 0) { if (ctdb_service(ctdb, fds.revents) < 0) {
ctdb_request_free(ctdb, req); /* It can have failed after it completed request. */
if (!*done)
ctdb_cancel(ctdb, req);
else
ctdb_request_free(ctdb, req);
return NULL; return NULL;
} }
} }