11c0f99 Ticket #47349 - DS instance crashes under a high load

Authored and Committed by rmeggins 8 years ago
    Ticket #47349 - DS instance crashes under a high load
    Reviewed by: nkinder (Thanks!)
    Branch: 389-ds-base-1.3.0
    Fix Description: handle_new_connection initializes the connection object,
    then calls connection_table_move_connection_on_to_active_list to put it
    on the list of active connections, then unlocks the c_mutex, then calls
    connection_new_private to allocate c_private.  If another thread
    interrupts after the conn has been moved to the active list, but before
    c_private has been allocated, the new conn will be available via
    connection_table_iterate_active_connections where table_iterate_function
    will attempt to dereference the NULL c_private.
    The fix is to move connection_new_private inside the c_mutex lock, and to
    move connection_table_move_connection_on_to_active_list to be the very last
    thing before releasing the c_mutex lock.  Once the conn is on the active
    list it is live and we cannot do anything else to it.
    Note: I have still not been able to reproduce the problem in a non-debug
    optimized build.
    Platforms tested: RHEL6 x86_64
    Note: Before patch, server would crash within 5 minutes.  After patch, server
    has been running for several days in customer environment.
    Flag Day: no
    Doc impact: no
    (cherry picked from commit 05d209432571dc64b242ae47113ae4cbb43607d2)
file modified
+13 -12