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
28eaeb90
Commit
28eaeb90
authored
Nov 17, 2020
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vut: Print the diagnostics of VSL cursor failures
But paced, because they may repeat in a semi-tight loop.
parent
cea4eb2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
vut.c
lib/libvarnishapi/vut.c
+24
-0
No files found.
lib/libvarnishapi/vut.c
View file @
28eaeb90
...
...
@@ -34,6 +34,7 @@
#include "config.h"
#include <ctype.h>
#include <math.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>
...
...
@@ -382,12 +383,34 @@ VUT_Fini(struct VUT **vutp)
FREE_OBJ
(
vut
);
}
static
void
vut_CursorError
(
struct
VUT
*
vut
,
vtim_mono
*
last
)
{
const
char
*
diag
;
vtim_mono
now
;
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vsl
);
AN
(
last
);
diag
=
VSL_Error
(
vut
->
vsl
);
if
(
diag
==
NULL
)
diag
=
"Missing diagnostic"
;
now
=
VTIM_mono
();
if
(
isnan
(
*
last
)
||
*
last
+
1
<
now
)
{
fprintf
(
stderr
,
"Failed to acquire log: %s
\n
"
,
diag
);
*
last
=
now
;
}
}
int
VUT_Main
(
struct
VUT
*
vut
)
{
struct
VSL_cursor
*
c
;
int
i
=
-
1
;
int
hascursor
=
-
1
;
vtim_mono
t_failcursor
=
NAN
;
CHECK_OBJ_NOTNULL
(
vut
,
VUT_MAGIC
);
AN
(
vut
->
vslq
);
...
...
@@ -442,6 +465,7 @@ VUT_Main(struct VUT *vut)
(
vut
->
d_opt
?
VSL_COPT_TAILSTOP
:
VSL_COPT_TAIL
)
|
VSL_COPT_BATCH
);
if
(
c
==
NULL
)
{
vut_CursorError
(
vut
,
&
t_failcursor
);
VSL_ResetError
(
vut
->
vsl
);
continue
;
}
...
...
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