BUG/MEDIUM: connections: Remove the connection from the idle list before destroy.
Before calling the destroy() method, remove the connection from the idle list,
so that no new session will pick it.
diff --git a/src/backend.c b/src/backend.c
index 8e27696..19157ba 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1213,7 +1213,10 @@
*/
if (old_conn && !did_switch) {
old_conn->owner = NULL;
- old_conn->mux->destroy(old_conn);
+ LIST_DEL(&old_conn->list);
+ LIST_INIT(&old_conn->list);
+ if (old_conn->mux)
+ old_conn->mux->destroy(old_conn);
old_conn = NULL;
}
}