[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5814) concurrent access to connections

ando@sys-net.it wrote:
> Hallvard B Furuseth wrote:
>> test036-meta-concurrency just crashed with fresh HEAD code.
>> I suppose that's the same as this ITS.
> Looks like.  However, now I thought my FIXME were little more than a
> precaution.  In fact, right now the only places where c_struct_state can
> be modified are protected by a mutex on connections_mutex; this should
> prevent changing the state of a connection during a connection_next()
> call.  Do you see a thread waiting on
> ldap_pvt_thread_mutex_lock(&connections_mutex ); at connection.c:427 or
> connection.c:514?  If that's the case, we probably need to move
> c->c_conn_state = SLAP_C_INACTIVE; inside the mutex in order to be able
> to safely assert in connection_next().  Is it worth?

That should not be necessary. c_struct_state is supposed to be protected by 
connections_mutex, while c_conn_state is supposed to be protected by 
c->c_mutex. As already described in the comments at the top of the file.

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/