]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10479 syncprov: more for prev commit master
authorHoward Chu <hyc@openldap.org>
Sat, 1 Aug 2026 15:43:50 +0000 (16:43 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 3 Aug 2026 14:28:55 +0000 (15:28 +0100)
Partially revert prev commit. Move reset of PS_TASK_QUEUED flag
back to previous position. Don't reset the flag if we're just
dropping the op anyway.

servers/slapd/overlays/syncprov.c

index d7db9e739ba0c9f456e131a717cbd3a58de31400..ba25d8ac47e49b09d0a991f08344af2d5fed9a60 100644 (file)
@@ -1124,8 +1124,11 @@ syncprov_qtask( void *ctx, void *arg )
                return NULL;
        }
 
-       /* if an error occurred, or no responses left, task is no longer queued */
-       so->s_flags &= ~PS_TASK_QUEUED;
+       /* getting here means there were errors or there's nothing left
+        * to do, so this task will no longer be queued. But wait to
+        * reset the flag until we know we're not dropping the op
+        * ourselves.
+        */
 
        flag = FS_UNLINK;
 
@@ -1138,6 +1141,8 @@ syncprov_qtask( void *ctx, void *arg )
        /* decrement use count... */
        frc = syncprov_free_syncop( so, flag );
        if ( frc == FSR_NOTFREE ) {
+               /* we're not dropping the op, but it is no longer queued. */
+               so->s_flags &= ~PS_TASK_QUEUED;
                ldap_pvt_thread_mutex_unlock( &so->s_mutex );
        }