* Notice from idle server tagged server dirty.
release_server() did not expect it. Fix it
by dropping them.
+2007-04-11 - PgBouncer 1.0.4 - "Last 'last' bug"
+
+ * Notice from idle server tagged server dirty.
+ release_server() did not expect it. Fix it
+ by dropping them.
+
2007-04-11 - PgBouncer 1.0.3 - "Fearless Fork"
= Fixes =
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(pgbouncer, 1.0.3)
+AC_INIT(pgbouncer, 1.0.4)
AC_CONFIG_SRCDIR(src/bouncer.h)
AC_CONFIG_HEADER(config.h)
+pgbouncer (1.0.4-1) unstable; urgency=low
+
+ * last bug, honestly.
+
+ -- Marko Kreen <marko.kreen@skype.net> Wed, 11 Apr 2007 12:03:52 +0300
+
pgbouncer (1.0.3-1) unstable; urgency=low
* more error handling fixes.
PgSocket *server;
bool res = true;
- server = first_socket(&pool->used_server_list);
+ /* find clean server */
+ while (1) {
+ server = first_socket(&pool->used_server_list);
+ if (!server)
+ return;
+ if (server->ready)
+ break;
+ disconnect_server(server, true, "idle server got dirty");
+ }
/* is the check needed? */
if (q == NULL || q[0] == 0)
if (server->close_needed)
disconnect_server(server, true, "db conf changed");
+ else if (server->state == SV_IDLE && !server->ready)
+ disconnect_server(server, true, "SV_IDLE server got dirty");
+ else if (server->state == SV_USED && !server->ready)
+ disconnect_server(server, true, "SV_USED server got dirty");
else if (cf_server_idle_timeout > 0 && idle > cf_server_idle_timeout)
disconnect_server(server, true, "server idle timeout");
else if (cf_server_lifetime > 0 && age > cf_server_lifetime)
/* try to get idle server, if allowed */
if (cf_pause_mode == P_PAUSE)
server = NULL;
- else
- server = first_socket(&pool->idle_server_list);
+ else {
+ while (1) {
+ server = first_socket(&pool->idle_server_list);
+ if (!server || server->ready)
+ break;
+ disconnect_server(server, true, "idle server got dirty");
+ }
+ }
/* link or send to waiters list */
if (server) {
/* got all params */
finish_welcome_msg(server);
- // FIXME: res check
res = release_server(server);
/* let the takeover process handle it */
return false;
}
+ /*
+ * 'E' and 'N' packets currently set ->ready to 0. Correct would
+ * be to leave ->ready as-is, because overal TX state stays same.
+ * It matters for connections in IDLE or USED state which get dirty
+ * suddenly but should not as they are still usable.
+ *
+ * But the 'E' or 'N' packet between transactions signifies probably
+ * dying backend. This its better to tag server as dirty and drop
+ * it later.
+ */
case 'E': /* ErrorResponse */
case 'N': /* NoticeResponse */