* that the handler needs to check it under the idle conns lock.
*/
HA_ATOMIC_OR(&fconn->wait_event.tasklet->state, TASK_F_USR1);
+ xprt_set_idle(fconn->conn, fconn->conn->xprt, fconn->conn->xprt_ctx);
/* Ensure session can keep a new idle connection. */
if (session_check_idle_conn(sess, fconn->conn) != 0) {
TRACE_DEVEL("outgoing connection killed", FCGI_EV_STRM_END|FCGI_EV_FCONN_ERR);
return;
}
+
+ /* At this point, the connection is inserted into
+ * session list and marked as idle, so it may already
+ * have been purged from another thread.
+ */
+ TRACE_DEVEL("private connection marked as idle", FCGI_EV_STRM_END, fconn->conn);
+ return;
}
}
else {
* that the handler needs to check it under the idle conns lock.
*/
HA_ATOMIC_OR(&h1c->wait_event.tasklet->state, TASK_F_USR1);
+ h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
+ xprt_set_idle(h1c->conn, h1c->conn->xprt, h1c->conn->xprt_ctx);
/* Ensure session can keep a new idle connection. */
if (session_check_idle_conn(sess, h1c->conn)) {
h1c->conn->mux->destroy(h1c);
goto released;
}
+
+ /* At this point, the connection is inserted into
+ * session list and marked as idle, so it may already
+ * have been purged from another thread.
+ */
+ goto end;
}
else {
if (h1c->conn->owner == sess)
* that the handler needs to check it under the idle conns lock.
*/
HA_ATOMIC_OR(&h2c->wait_event.tasklet->state, TASK_F_USR1);
+ xprt_set_idle(h2c->conn, h2c->conn->xprt, h2c->conn->xprt_ctx);
/* Ensure session can keep a new idle connection. */
if (session_check_idle_conn(sess, h2c->conn) != 0) {
TRACE_DEVEL("leaving without reusable idle connection", H2_EV_STRM_END);
return;
}
+
+ /* At this point, the connection is inserted into
+ * session list and marked as idle, so it may already
+ * have been purged from another thread.
+ */
+ TRACE_DEVEL("private connection marked as idle", H2_EV_STRM_END);
+ return;
}
}
else {
* that the handler needs to check it under the idle conns lock.
*/
HA_ATOMIC_OR(&spop_conn->wait_event.tasklet->state, TASK_F_USR1);
+ xprt_set_idle(spop_conn->conn, spop_conn->conn->xprt, spop_conn->conn->xprt_ctx);
/* Ensure session can keep a new idle connection. */
if (session_check_idle_conn(sess, spop_conn->conn) != 0) {
TRACE_DEVEL("leaving without reusable idle connection", SPOP_EV_STRM_END);
return;
}
+
+ /* At this point, the connection is inserted into
+ * session list and marked as idle, so it may already
+ * have been purged from another thread.
+ */
+ TRACE_DEVEL("private connection marked as idle", SPOP_EV_STRM_END);
+ return;
}
}
else {