From 720c930a6d4eb4b92d3a10246b2ce6277e47484e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 1 Aug 2026 16:43:50 +0100 Subject: [PATCH] ITS#10479 syncprov: more for prev commit 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index d7db9e739b..ba25d8ac47 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -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 ); } -- 2.47.3