• Julien Muchembled's avatar
    connection: make close always call handler (connectionClosed or connectionFailed) · 4b6c1387
    Julien Muchembled authored
    Main reason is that it's difficult to know in advance which side really closes
    the connection. Network events can be chaotic and this could lead to many race
    conditions.
    Thus, handler can be used to update any database that is somewhat redundant
    to the connection status, i.e. node status usually. Safely and less duplicated
    code.
    
    This change is motivated by recurrent random failures during election.
    An example of race condition was that 2 fully connected master could close the
    extra connection (the primary -> secondary one) at the same time.
    
    In order to stabilize lower-level code and start with reliable election process,
    code has also been simplified to not care about node states. All connections
    without exception are closed at the end of the election and states are then
    updated 1 by 1 by identification handler.
    Note that during election, there may be 2 connection per node, which makes
    difficult to update node states by connectionFailed/connectionClosed events.
    
    timeoutExpired & peerBroken are dropped as they are unused for the moment.
    A new API should be designed so that connectionClosed know the reason of the
    close.
    BROKEN state becomes unused.
    
    git-svn-id: https://svn.erp5.org/repos/neo/trunk@2732 71dcc9de-d417-0410-9af5-da40c76e7ee4
    4b6c1387
Name
Last commit
Last update
buildout Loading commit data...
eggs Loading commit data...
neo Loading commit data...
tools Loading commit data...
MANIFEST.in Loading commit data...
README Loading commit data...
TESTS.txt Loading commit data...
TODO Loading commit data...
neo.conf Loading commit data...
neoadmin Loading commit data...
neoctl Loading commit data...
neomaster Loading commit data...
neomigrate Loading commit data...
neostorage Loading commit data...
setup.py Loading commit data...
setup_admin.py Loading commit data...
setup_client.py Loading commit data...
setup_common.py Loading commit data...
setup_ctl.py Loading commit data...
setup_master.py Loading commit data...
setup_storage.py Loading commit data...
setup_tests.py Loading commit data...