Deferred attach: create the timed event as a child context of the da context we want...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 16 Mar 2011 03:55:58 +0000 (14:55 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 16 Mar 2011 03:55:58 +0000 (14:55 +1100)
Othwervise the da context can be timed out and talloc_free()d
but the event for this already freed object will still trigger,
causing a talloc error and shutdown.

CQ S1022515

server/ctdb_ltdb_server.c

index f153eeb1425f070f89bddf99ff4a5cbf9bda5687..6a1244186b4508a8704235d8d86c609707396131 100644 (file)
@@ -990,7 +990,7 @@ int ctdb_process_deferred_attach(struct ctdb_context *ctdb)
         */
        while ((da_ctx = ctdb->deferred_attach) != NULL) {
                DLIST_REMOVE(ctdb->deferred_attach, da_ctx);
-               event_add_timed(ctdb->ev, ctdb, timeval_current_ofs(1,0), ctdb_deferred_attach_callback, da_ctx);
+               event_add_timed(ctdb->ev, da_ctx, timeval_current_ofs(1,0), ctdb_deferred_attach_callback, da_ctx);
        }
 
        return 0;