]> granicus.if.org Git - pgbouncer/commitdiff
Disable maintenance during SUSPEND
authorMarko Kreen <markokr@gmail.com>
Fri, 13 Nov 2009 13:55:59 +0000 (13:55 +0000)
committerMarko Kreen <markokr@gmail.com>
Fri, 13 Nov 2009 13:55:59 +0000 (13:55 +0000)
Otherwise some timeout may activate and close connection
that is already reported to other side;

src/janitor.c

index 4dd4d14ce42daff2c7ee79ecb50cc575d48e53ba..0de654e8f1e40aaf86981e2b8711270842013bfd 100644 (file)
@@ -503,6 +503,12 @@ static void do_full_maint(int sock, short flags, void *arg)
        List *item, *tmp;
        PgPool *pool;
 
+       /*
+        * Avoid doing anything that may surprise other pgbouncer.
+        */
+       if (cf_pause_mode == P_SUSPEND)
+               goto skip_maint;
+
        statlist_for_each_safe(item, &pool_list, tmp) {
                pool = container_of(item, PgPool, head);
                if (pool->db->admin)
@@ -531,6 +537,7 @@ static void do_full_maint(int sock, short flags, void *arg)
        if (cf_auth_type >= AUTH_TRUST)
                loader_users_check();
 
+skip_maint:
        safe_evtimer_add(&full_maint_ev, &full_maint_period);
 }