8f04487 Ticket 49768 - Under network intensive load persistent search can erronously decrease connection refcnt

Authored and Committed by tbordaz 6 years ago
    Ticket 49768 - Under network intensive load persistent search can erronously decrease connection refcnt
    
    Bug Description:
    	If a connection enters in turbo mode (because of high traffic) or
    	a worker reads several requests in the read buffer (more_data), the thread
    	keeps processing connection.
    	In that condition it should not decrease the refcnt.
    	In case the operation is a persistent search, it decreases systematically
    	the refcnt.
    	So refcnt can become lower than the actual number of threads active on the connection.
    
    	Most of the time it can create messages like
    		Attempt to release connection that is not acquired
    	In some rare case, if the a connection is out of the active list but a remaining thread
    	tries to remove it again it can lead to a crash
    
    Fix Description:
    	The fix consist, when processing a PS, to decrease the refcnt at the condition
    	the connection is not in turbo mode or in more_data.
    
    https://pagure.io/389-ds-base/issue/49768
    
    Reviewed by: Mark Reynolds
    
    Platforms tested: F26
    
    Flag Day: no
    
    Doc impact: no