Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: mail/dovecot: fix infinity loop in replicator
To:
Brad Smith <brad@comstyle.com>
Cc:
OpenBSD ports <ports@openbsd.org>, Klemens Nanni <kn@openbsd.org>
Date:
Sat, 05 Oct 2024 00:58:51 +0200

Download raw body.

Thread
On Sat, 05 Oct 2024 00:39:40 +0200,
Brad Smith <brad@comstyle.com> wrote:
> 
> On 2024-10-04 5:57 p.m., Kirill A. Korinsky wrote:
> > ports@,
> > 
> > Here a patch which fixed an infinity loop inside dovecot replicator when it
> > is used with any value of replication_sync_timeout.
> > 
> > This patch was backported to upstream as
> > https://github.com/dovecot/core/pull/223 but replicator was removed from the
> > next release and I doubt that it will be merged.
> > 
> > Anyway, I'm using it for a more than a week and quite happy with it.
> 
> Add a comment at the top of the patch that says..
> 
> --
> replicator: fixed infinity loop on sync replication
> https://github.com/dovecot/core/pull/223
> --

Here it is:

Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/dovecot/Makefile,v
retrieving revision 1.318
diff -u -p -r1.318 Makefile
--- Makefile	16 Aug 2024 10:56:01 -0000	1.318
+++ Makefile	4 Oct 2024 22:58:16 -0000
@@ -11,6 +11,7 @@ COMMENT-postgresql= PostgreSQL authentic
 V_MAJOR=	2.3
 V_DOVECOT=	2.3.21.1
 EPOCH=		0
+REVISION=	0
 
 DISTNAME=	dovecot-${V_DOVECOT}
 PKGNAME=	dovecot-${V_DOVECOT}
Index: patches/patch-src_replication_replicator_replicator-queue_c
===================================================================
RCS file: patches/patch-src_replication_replicator_replicator-queue_c
diff -N patches/patch-src_replication_replicator_replicator-queue_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_replication_replicator_replicator-queue_c	4 Oct 2024 22:58:16 -0000
@@ -0,0 +1,14 @@
+replicator: fixed infinity loop on sync replication
+https://github.com/dovecot/core/pull/223
+
+Index: src/replication/replicator/replicator-queue.c
+--- src/replication/replicator/replicator-queue.c.orig
++++ src/replication/replicator/replicator-queue.c
+@@ -333,6 +333,7 @@ replicator_queue_handle_sync_lookups(struct replicator
+ 		} else {
+ 			array_push_back(&callbacks, &lookups[i]);
+ 			array_delete(&queue->sync_lookups, i, 1);
++			count--;
+ 		}
+ 	}
+ 


-- 
wbr, Kirill