[Date Prev][Date Next]
Re: (ITS#6104) race condition with cancel operation
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#6104) race condition with cancel operation
- From: email@example.com
- Date: Mon, 11 May 2009 22:14:59 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Hallvard B Furuseth wrote:
> firstname.lastname@example.org writes:
>>> slapd/cancel.c sets o_abandon before o_cancel. Thus it's possible for
>>> the canceled operation to obey o_abandon before o_cancel gets set.
>> Cancel is just best-effort, why not just set o_cancel before o_abandon?
> Memory coherence. Without mutex protection, the cancelled thread might
> still see the o_abandon change before the o_cancel change. And thus not
> send a response, nor update info for the Cancel operation to react to.
I'd prefer to condense it all into a bitfield. We already ensure that the
c_mutex is held when setting these flags. It would be a lot of overhead to
grab the mutex just to read the flag, and would require additional analysis to
make sure the new locking behavior doesn't introduce new deadlocks.
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/