]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Fix hang when flushing a corked print-ostream
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 14 Apr 2022 11:46:59 +0000 (13:46 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 20 Apr 2022 12:42:48 +0000 (15:42 +0300)
This could have happened at least with doveadm sync/backup command,
i.e. causing replication to hang until timeout is reached:

Error: write(<local>) failed: Timed out after 60 seconds

src/doveadm/doveadm-print-server.c

index 86688231fd6aa7fd7d5691a36dbf3f90b7073282..93c6ed92538bf891565a293e02d7d2352c8632b7 100644 (file)
@@ -87,6 +87,7 @@ static void doveadm_print_server_flush(void)
        o_stream_nsend(doveadm_print_ostream,
                       str_data(ctx.str), str_len(ctx.str));
        str_truncate(ctx.str, 0);
+       o_stream_uncork(doveadm_print_ostream);
 
        if (o_stream_get_buffer_used_size(doveadm_print_ostream) < IO_BLOCK_SIZE ||
            doveadm_print_ostream->stream_errno != 0)