[SCM] CTDB repository - branch status-test-2 created - ctdb-1.0.104-19-g1d24a38

Ronnie Sahlberg sahlberg at samba.org
Tue Nov 24 18:02:05 MST 2009


The branch, status-test-2 has been created
        at  1d24a3869fe89fc9a109fd9e9b69df5fc665a5f6 (commit)

- Log -----------------------------------------------------------------
commit 1d24a3869fe89fc9a109fd9e9b69df5fc665a5f6
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Wed Nov 25 11:02:29 2009 +1030

    eventscript: check that ctdb forced script events correct
    
    Now we're doing checking, we might as well make sure the commands from
    "ctdb eventscripts" are valid.
    
    This gets rid of the "UNKNOWN" event type.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 83b7b233cb4707e826f6ba260bd630c8bc8f1e76
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:23:13 2009 +1030

    eventscript: check that internal script events are being invoked correctly
    
    This is not as good as a compile-time check, but at least we count the
    number of arguments are correct.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 33fb0e7ba047ca73969b59bccf70a04a17c25a0a
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:22:46 2009 +1030

    eventscript: remove call name from state->options
    
    Finally, we remove the call name (eg. "monitor" or "start") from the
    options field of the struct: it now contains only extra options.
    
    This is clearer, and mainly involves adding some %s to debug statements.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 6c79fa33e26cc4f0873577f8e122b1495b4c427e
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:19:58 2009 +1030

    eventscript: put call type into state struct.
    
    This means we can get rid of more strcmp; they can simply use the
    state->call value instead.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 8001488be4f2beb25e943fe01b2afc2e8779930d
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:16:49 2009 +1030

    eventscript: introduce enum for different event script calls.
    
    Rather than doing strcmp everywhere, pass an explicit enum around.  This
    also subtly documents what options are available.  The "options" arg
    is now used for extra arguments only.
    
    Unfortunately, gcc complains on empty format strings, so we make
    ctdb_event_script() take no varargs, and add ctdb_event_script_args().  We
    leave ctdb_event_script_callback() taking varargs, which means callers
    have to do "%s", "".
    
    For the moment, we have CTDB_EVENT_UNKNOWN for handling forced scripts
    from the ctdb tool.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 533c3e053293941d2a9484b495e78d45f478bb08
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:09:46 2009 +1030

    eventscript: put timeout inside ctdb_event_script_callback_v
    
    Everyone uses the same timeout value, so just remove it from the API.
    If we ever need variable timeouts, that might as well be central too.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 466beafadb37011fe273de8810ab0012e92a1fd8
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:09:01 2009 +1030

    eventscript: cleanup ctdb_event_script_v
    
    ctdb_event_script_v doesn't take varargs.  ctdb_run_event_script is
    a better name, and fix comment.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit b90bdb07c1f6913ddbf11bde9684bdc8af61c549
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:06:53 2009 +1030

    eventscript: fix bug in timeouts on forced eventscripts.  Again.
    
    In 15bc66ae801b0c69, Ronnie fixed a double-free race.  The problem was that
    ctdb_run_eventscripts() hands a context to ctdb_event_script_callback() to
    hang its data off, which gets freed in the callback.  This particularly
    hurt in ctdb_event_script_timeout.
    
    There's nothing wrong with this, but obviously we should make the callback
    call last of all.  At the time, ctdb_event_script_timeout() carefully
    extracted everything from the struct ctdb_event_script_state before
    calling ->callback.
    
    This was cleaned up in 64da4402c6ad485f (Ronnie again), and now state
    was referred to after the callback again.  But the same change introduced
    a direct use-after-free bug which caused an occasional oops.
    
    So in our last episode (eda052101728cf92) Volker fixed this, and Michael
    committed it.
    
    But we still have the double free bug which 15bc66ae801b0c69 was supposed
    to fix!  Let's try to fix this in a more permanent way, but always doing
    the callback from the destructor.  This means we need to hold the status,
    and don't send the KILL signal if ->child is set to 0.
    
    Finally, add a comment about freeing ourselves in run_eventscripts_callback
    and the structure definition.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 6804f880436645b52c09a78fa300377fa8058d0e
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Nov 24 11:00:13 2009 +1030

    eventscript: clean up forked handler event code
    
    Write the whole int through the pipe, rather than quietly cutting it
    off.  Also, use -2 as the result if the read fails; -1 comes from many
    paths if the child fails before running the script.
    
    Add a comment about why we don't need to check the write.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit defbe318152fc479e8076ad70433cdb4971951af
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Nov 25 11:00:11 2009 +1030

    rework and simplify the eventscript handling
    
    This version has no trailing whitespace, and fixed

-----------------------------------------------------------------------


-- 
CTDB repository


More information about the samba-cvs mailing list