[4.1] a16aa3b Document that VCL_EVENT_USE is deprecated
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 14 15:15:07 CET 2016
commit a16aa3bc871b092b67f4b9132452271141a999c3
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Dec 1 12:46:43 2015 +0100
Document that VCL_EVENT_USE is deprecated
And stop using it in the test suite.
Also for 4.1
diff --git a/bin/varnishtest/tests/v00044.vtc b/bin/varnishtest/tests/v00044.vtc
index c3fd107..aa79e6a 100644
--- a/bin/varnishtest/tests/v00044.vtc
+++ b/bin/varnishtest/tests/v00044.vtc
@@ -7,7 +7,7 @@ server s1 -repeat 20 {
close
} -start
-# The debug vmod logs some vcl events
+# The debug vmod logs temperature vcl events
varnish v1 -arg "-p vcl_cooldown=1" -vcl {
import ${vmod_debug};
backend default {
@@ -69,7 +69,6 @@ varnish v1 -clierr 106 "vcl.state vcl2 cold"
logexpect l1 -v v1 -g raw {
expect * 0 Debug "vcl1: VCL_EVENT_COLD"
expect * 0 Debug "vcl1: VCL_EVENT_WARM"
- expect * 0 Debug "vcl1: VCL_EVENT_USE"
} -start
# ...when you use a cold VCL
diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst
index 0d30162..fac9e70 100644
--- a/doc/sphinx/reference/vmod.rst
+++ b/doc/sphinx/reference/vmod.rst
@@ -358,10 +358,10 @@ Event functions
VMODs can have an "event" function which is called when a VCL which imports
the VMOD is loaded, made active, or discarded. This corresponds to the
-``VCL_EVENT_LOAD``, ``VCL_EVENT_USE``, and ``VCL_EVENT_DISCARD`` events,
-respectively. In addition, this function will be called when the VCL state is
-changed to cold or warm, corresponding to the ``VCL_EVENT_COLD`` and
-``VCL_EVENT_WARM`` events.
+``VCL_EVENT_LOAD``, and ``VCL_EVENT_DISCARD`` events, respectively. In
+addition, this function will be called when the VCL temperature is changed to
+cold or warm, corresponding to the ``VCL_EVENT_COLD`` and ``VCL_EVENT_WARM``
+events.
The first argument to the event function is a VRT context.
@@ -379,11 +379,13 @@ discarded and free this global state when the count reaches zero.
VMOD writers are *strongly* encouraged to release all per-VCL resources for a
given VCL when it emits a ``VCL_EVENT_COLD`` event. You will get a chance to
reacquire the resources before the VCL becomes active again and be notified
-first with a ``VCL_EVENT_WARM`` event, and then a ``VCL_EVENT_USE`` event.
-Unless a user decides that a given VCL should always be warm, an inactive VMOD
-will eventually become cold and should manage resources accordingly.
+first with a ``VCL_EVENT_WARM`` event. Unless a user decides that a given VCL
+should always be warm, an inactive VMOD will eventually become cold and should
+manage resources accordingly.
-.. TODO vmod objects
+There is also a ``VCL_EVENT_USE`` event. Please note that this event is now
+deprecated and may be removed in a future release. A warm VCL should be ready
+to use so no additional task should be postponed at use time.
When to lock, and when not to lock
==================================
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 732d89a..b065b7f 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -258,7 +258,6 @@ event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
switch (e) {
case VCL_EVENT_COLD: ev = "VCL_EVENT_COLD"; break;
case VCL_EVENT_WARM: ev = "VCL_EVENT_WARM"; break;
- case VCL_EVENT_USE: ev = "VCL_EVENT_USE"; break;
default: ev = NULL;
}
More information about the varnish-commit
mailing list