]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Fix assert-crash when flush script takes too long
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 10 Jan 2017 11:29:34 +0000 (13:29 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 10 Jan 2017 11:29:34 +0000 (13:29 +0200)
Fixes:
Panic: file director.c: line 966 (director_user_move_timeout): assertion failed: (user->kill_ctx->kill_state != USER_KILL_STATE_FLUSHING)

src/director/director.c

index ecf77695f2c01848bd6632d5cdc3090dffd63830..141788c71ff8b8db35e360fc88a0b7c88577c701 100644 (file)
@@ -966,7 +966,6 @@ static void director_user_move_throttled(unsigned int new_events_count,
 static void director_user_move_timeout(struct user *user)
 {
        i_assert(user->kill_ctx != NULL);
-       i_assert(user->kill_ctx->kill_state != USER_KILL_STATE_FLUSHING);
        i_assert(user->kill_ctx->kill_state != USER_KILL_STATE_DELAY);
 
        if (log_throttle_accept(user_move_throttle)) {
@@ -975,6 +974,10 @@ static void director_user_move_timeout(struct user *user)
                        user->username_hash,
                        user_kill_state_names[user->kill_ctx->kill_state]);
        }
+       if (user->kill_ctx->kill_state == USER_KILL_STATE_FLUSHING) {
+               o_stream_unref(&user->kill_ctx->reply);
+               program_client_destroy(&user->kill_ctx->pclient);
+       }
        director_user_move_free(user);
 }