]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-dsync: Always cleanup after connection
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 10 May 2019 12:55:22 +0000 (15:55 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 13 May 2019 11:30:15 +0000 (11:30 +0000)
Go through the same error handling path every time. Fixes
Panic: file ioloop.c: line 826 (io_loop_destroy): assertion failed: (ioloop == current_ioloop)

This happened because the ioloop wasn't destroyed
on error.

src/doveadm/doveadm-dsync.c

index db0d7f522e646d0ed52bfe4809ab7b6af8bb362a..720e6a67937f7541aff22f777fbdd770d26b214f 100644 (file)
@@ -857,17 +857,16 @@ dsync_connect_tcp(struct dsync_cmd_context *ctx,
                        "[dsync - connecting to %s]", server->name));
        }
        if (server_connection_create(server, &conn) < 0) {
-               *error_r = "Couldn't create server connection";
-               return -1;
-       }
+               ctx->error = "Couldn't create server connection";
+       } else {
+               if (doveadm_verbose_proctitle) {
+                       process_title_set(t_strdup_printf(
+                               "[dsync - running dsync-server on %s]", server->name));
+               }
 
-       if (doveadm_verbose_proctitle) {
-               process_title_set(t_strdup_printf(
-                       "[dsync - running dsync-server on %s]", server->name));
+               dsync_server_run_command(ctx, conn);
        }
 
-       dsync_server_run_command(ctx, conn);
-
        if (array_count(&server->connections) > 0)
                server_connection_destroy(&conn);