Unverified Commit 060175fe authored by Reza Naghibi's avatar Reza Naghibi Committed by Nils Goroll

Add connection reuse status to BackendOpen and BackendClose

parent a5fb7797
......@@ -202,8 +202,9 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, struct backend *bp,
PFD_LocalName(pfd, abuf1, sizeof abuf1, pbuf1, sizeof pbuf1);
PFD_RemoteName(pfd, abuf2, sizeof abuf2, pbuf2, sizeof pbuf2);
VSLb(bo->vsl, SLT_BackendOpen, "%d %s %s %s %s %s",
*fdp, VRT_BACKEND_string(bp->director), abuf2, pbuf2, abuf1, pbuf1);
VSLb(bo->vsl, SLT_BackendOpen, "%d %s %s %s %s %s %s",
*fdp, VRT_BACKEND_string(bp->director), abuf2, pbuf2, abuf1, pbuf1,
PFD_State(pfd) == PFD_STATE_STOLEN ? "reuse" : "connect");
INIT_OBJ(bo->htc, HTTP_CONN_MAGIC);
bo->htc->priv = pfd;
......@@ -235,14 +236,14 @@ vbe_dir_finish(VRT_CTX, VCL_BACKEND d)
assert(bo->htc->doclose == SC_TX_PIPE ||
bo->htc->doclose == SC_RX_TIMEOUT);
if (bo->htc->doclose != SC_NULL || bp->proxy_header != 0) {
VSLb(bo->vsl, SLT_BackendClose, "%d %s", *PFD_Fd(pfd),
VSLb(bo->vsl, SLT_BackendClose, "%d %s close", *PFD_Fd(pfd),
VRT_BACKEND_string(bp->director));
VTP_Close(&pfd);
AZ(pfd);
Lck_Lock(&bp->mtx);
} else {
assert (PFD_State(pfd) == PFD_STATE_USED);
VSLb(bo->vsl, SLT_BackendClose, "%d %s", *PFD_Fd(pfd),
VSLb(bo->vsl, SLT_BackendClose, "%d %s recycle", *PFD_Fd(pfd),
VRT_BACKEND_string(bp->director));
Lck_Lock(&bp->mtx);
VSC_C_main->backend_recycle++;
......
......@@ -24,5 +24,5 @@ logexpect l2 -v v1 -d 1 -g vxid {
logexpect l3 -v v1 -d 1 -g vxid {
expect * * Begin ^bereq
expect * = BackendOpen "0.0.0.0 0 0.0.0.0 0$"
expect * = BackendOpen "0.0.0.0 0 0.0.0.0 0 connect$"
} -run
......@@ -106,14 +106,15 @@ SLTM(SessClose, 0, "Client connection closed",
SLTM(BackendOpen, 0, "Backend connection opened",
"Logged when a new backend connection is opened.\n\n"
"The format is::\n\n"
"\t%d %s %s %s %s %s\n"
"\t| | | | | |\n"
"\t| | | | | +- Local port\n"
"\t| | | | +---- Local address\n"
"\t| | | +------- Remote port\n"
"\t| | +---------- Remote address\n"
"\t| +------------- Backend display name\n"
"\t+---------------- Connection file descriptor\n"
"\t%d %s %s %s %s %s %s\n"
"\t| | | | | | |\n"
"\t| | | | | | +- \"connect\" or \"reuse\"\n"
"\t| | | | | +---- Local port\n"
"\t| | | | +------- Local address\n"
"\t| | | +---------- Remote port\n"
"\t| | +------------- Remote address\n"
"\t| +---------------- Backend display name\n"
"\t+------------------- Connection file descriptor\n"
"\n"
)
......@@ -132,11 +133,12 @@ SLTM(BackendReuse, 0, "Backend connection put up for reuse",
SLTM(BackendClose, 0, "Backend connection closed",
"Logged when a backend connection is closed.\n\n"
"The format is::\n\n"
"\t%d %s [ %s ]\n"
"\t| | |\n"
"\t| | +- Optional reason\n"
"\t| +------ Backend display name\n"
"\t+--------- Connection file descriptor\n"
"\t%d %s %s [ %s ]\n"
"\t| | | |\n"
"\t| | | +- Optional reason\n"
"\t| | +------ \"close\" or \"recycle\"\n"
"\t| +--------- Backend display name\n"
"\t+------------ Connection file descriptor\n"
"\n"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment