s3:dbwrap_ctdb: improve the error handling in ctdb_async_ctx_init_internal() master
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Jun 2022 09:35:31 +0000 (11:35 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 1 Jul 2022 18:34:17 +0000 (18:34 +0000)
We should not map any error from ctdbd_init_async_connection() to EIO.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul  1 18:34:17 UTC 2022 on sn-devel-184

source3/lib/dbwrap/dbwrap_ctdb.c

index 0907089164a946d5df476992b7d97ffd5143af9a..c0af5729f3220cbfe24ebbec3fde6ab0b22c24cc 100644 (file)
@@ -99,11 +99,17 @@ static int ctdb_async_ctx_init_internal(TALLOC_CTX *mem_ctx,
                &ctdb_async_ctx.async_conn);
        unbecome_root();
 
-       if (ret != 0 || ctdb_async_ctx.async_conn == NULL) {
-               DBG_ERR("ctdbd_init_connection failed\n");
-               return EIO;
+       if (ret != 0) {
+               DBG_ERR("ctdbd_init_async_connection(%s, timeout=%d) "
+                       "failed: ret=%d %s\n",
+                       lp_ctdbd_socket(),
+                       lp_ctdb_timeout(),
+                       ret, strerror(ret));
+               return ret;
        }
 
+       SMB_ASSERT(ctdb_async_ctx.async_conn != NULL);
+
        ctdb_async_ctx.initialized = true;
        return 0;
 }