s4-drepl: Schedule event to trigger replication rather than calling run_pending_ops...
authorKamen Mazdrashki <kamenim@samba.org>
Sat, 26 Feb 2011 21:13:49 +0000 (23:13 +0200)
committerKamen Mazdrashki <kamenim@samba.org>
Sat, 26 Feb 2011 22:23:18 +0000 (00:23 +0200)
Executing dreplsrv_run_pending_ops() directly may cause a segfault
as in case of failure, the _drepl_replica_sync_done_cb() callback
gets called *before* drepl_replica_sync() returns. In such case,
irpc message gets freed twice - once when irpc_send_reply() gets called
and once when drepl_replica_sync() returns

source4/dsdb/repl/drepl_service.c

index f4364afeebb10d912e0c1dc328fdb3d42c9cdce6..9248c831110fa5caca4970c5e69815e5dac1e580 100644 (file)
@@ -324,8 +324,11 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
        /* if we got here, everything is OK */
        r->out.result = WERR_OK;
 
-       /* force execution of scheduled replications */
-       dreplsrv_run_pending_ops(service);
+       /*
+        * schedule replication event to force
+        * replication as soon as possible
+        */
+       dreplsrv_periodic_schedule(service, 0);
 
 done:
        return NT_STATUS_OK;