Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
060175fe
Unverified
Commit
060175fe
authored
Jun 10, 2020
by
Reza Naghibi
Committed by
Nils Goroll
Jun 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add connection reuse status to BackendOpen and BackendClose
parent
a5fb7797
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
cache_backend.c
bin/varnishd/cache/cache_backend.c
+5
-4
b00060.vtc
bin/varnishtest/tests/b00060.vtc
+1
-1
vsl_tags.h
include/tbl/vsl_tags.h
+15
-13
No files found.
bin/varnishd/cache/cache_backend.c
View file @
060175fe
...
...
@@ -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
++
;
...
...
bin/varnishtest/tests/b00060.vtc
View file @
060175fe
...
...
@@ -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
include/tbl/vsl_tags.h
View file @
060175fe
...
...
@@ -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
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment