Skip to content
  • Alexander Nozdrin's avatar
    cdb6ddc9
    WL#7293: Make sure that when 32-bit connection-IDs roll over, still in-use · cdb6ddc9
    Alexander Nozdrin authored
    IDs are not re-issued
    
    Committed on behalf of Jon Olav Hauglid <jon.hauglid@oracle.com>.
    
    With this patch the currently used thread IDs are maintained in a sorted
    list so that it can be checked that each new connection is assigned an ID
    which is not currently in use. This prevents reuse of active IDs in cases
    where the 32 bit counter wraps around. The counter is kept at 32 bit as it
    is part of the client protocol.
    
    The patch makes code more consistent by using the my_pthread_id typedef
    instead of various uint/ulong variants.
    
    The patch also changes the thread_created counter to be incremented using
    atomics rather than protected by a separate mutex. The list of active THDs
    is changed from map to a sorted array.
    
    Combined this gives no reduced connect/disconnect performance even with the
    added processing required to assign unique IDs.
    cdb6ddc9
    WL#7293: Make sure that when 32-bit connection-IDs roll over, still in-use
    Alexander Nozdrin authored
    IDs are not re-issued
    
    Committed on behalf of Jon Olav Hauglid <jon.hauglid@oracle.com>.
    
    With this patch the currently used thread IDs are maintained in a sorted
    list so that it can be checked that each new connection is assigned an ID
    which is not currently in use. This prevents reuse of active IDs in cases
    where the 32 bit counter wraps around. The counter is kept at 32 bit as it
    is part of the client protocol.
    
    The patch makes code more consistent by using the my_pthread_id typedef
    instead of various uint/ulong variants.
    
    The patch also changes the thread_created counter to be incremented using
    atomics rather than protected by a separate mutex. The list of active THDs
    is changed from map to a sorted array.
    
    Combined this gives no reduced connect/disconnect performance even with the
    added processing required to assign unique IDs.
Loading