This document contains notes from the Varnish developers about ongoing development and past versions:
- Developers will note here changes which they consider particularly relevant or otherwise noteworthy
- This document is not necessarily up-to-date with the code
- It serves as a basis for release managers and others involved in release documentation
- It is not rendered as part of the official documentation and thus only available in ReStructuredText (rst) format in the source repository and -distribution.
Official information about changes in releases and advise on the
upgrade process can be found in the doc/sphinx/whats-new/
directory, also available in HTML format at
http://varnish-cache.org/docs/trunk/whats-new/index.html and via
individual releases. These documents are updated as part of the
release process.
The
hitmiss
andhitpass
handling indicators have been added to theVarnish:handling
format ofvarnishncsa
.The scope of VCL variables req.is_hitmiss and req.is_hitpass is now restricted to vcl_miss, vcl_deliver, vcl_pass, vcl_synth and vcl_pass, vcl_deliver, vcl_synth respectively.
Two fields have been added to the VMOD data registered with varnish-cache:
vcs
for Version Control System is intended as an identifier from the source code management system, e.g. the git revision, to identify the exact source code which was used to build a VMOD binary.version
is intended as a more user friendly identifier as to which version of a vmod a binary represents.
Panics and the
debug.vmod
CLI command output now contain these identifiers.Where supported by the compiler and linker, the
vcs
identifier is also reachable via the.vmod_vcs
section of the vmod shared object ELF file and can be extracted, for example, usingreadelf -p.vmod_vcs <file>
vmodtool.py
now creates a filevmod_vcs_version.txt
in the current working directory when called from a git tree. This file is intended to transport version control system information to builds from distribution bundles.vmod authors should add it to the distribution and otherwise ignore it for SCM.
Where git and automake are used, this can be accomplished by adding
vmod_vcs_version.txt
to the.gitignore
file and to theEXTRA_DIST
andDISTCLEANFILES
variables inMakefile.am
.If neither git is used nor
vmod_vcs_version.txt
present,vmodtool.py
will addNOGIT
to the vmod as the vcs identifier.vmodtool.py
now accepts a$Version
stanza in vmod vcc files to set the vmod version as registered with Varnish-Cache. If$Version
is not present, an attempt is made to extractPACKAGE_STRING
from an automakeMakefile
, otherwiseNOVERSION
is used as the version identifier.The scope of VCL variables
req.is_hitmiss
andreq.is_hitpass
is now restricted tovcl_miss, vcl_deliver, vcl_pass, vcl_synth
andvcl_pass, vcl_deliver, vcl_synth
respectively.
- Fixed a bug introduced in 7.6.0 that could trigger a panic when using dynamic backends (4183).
- Resolved a race condition that caused Varnish to exceed the connection limit
set to a backend with the
.max_connections
attribute (4154). - Fixed an assertion that was added in 7.6.0 and that could lead to a panic in the waiter code under certain conditions (4204).
- Removed an assertion on the pid value of varnishd that could trigger a panic in container environments.
- Added attempt to raise RLIMIT_MEMLOCK to infinity on startup and improved logging for VSM mlock() errors. (4193)
The Varnish Delivery Processor (VDP) filter API has been generalized to also accommodate future use for backend request bodies:
VDP_Init()
gained astruct busyobj *
argument for use of VDPs on the backend side, which is mutually exclusive with the existingstruct req *
argument (one of the two needs to beNULL
).VDP_Init()
also gained anintmax_t *
pointer, which needs to point to the known content length of the body data or-1
for "unknown length". Filters can change this value.struct vdp_ctx
lost thereq
member, but gainedstruct objcore *oc
,struct http *hp
andintmax_t *clen
members. The rationale here is that a VDP should be concerned mainly with transforming body data (for whichclen
is relevant) and optionally changing (from thevdp_init_f
) the headers sent before the body data, for whichhp
is intended. Some VDPs also work directly on astruct objcore *
, sooc
is provided to the first VDP in the chain only.Generic VDPs should specifically not access the request or be concerned with the object.
Yet special purpose VDPs still can take from
VRT_CTX
whatever references they need in thevdp_init_f
and store them in their private data.Consequent to what as been explained above,
vdp_init_f
lost itsstruct objcore *
argument.
VDPs with no
vdp_bytes_f
function are now supported if thevdp_init_f
returns a value greater than zero to signify that the filter is not to be added to the chain. This is useful to support VDPs which only need to work on headers.The
epoll
andkqueue
waiters have been improved to correctly reportWAITER_REMCLOSE
, which increases theWAITER.*.remclose
counter.varnishtest
now supports theshutdown
command corresponding to theshutdown(2)
standard C library call.VSC counters for waiters have been added:
conns
to count waits on idle connectionsremclose
to count idle connections closed by the peertimeout
to count idle connections which timed out in the waiteraction
to count idle connections which resulted in a read
These can be found under
WAITER.<poolname>.
.The port of a listen_endpoint given with the
-a
argument tovarnishd
can now also be a numerical port range like80-89
, besides the existing options of port number (e.g.80
) and service name (e.g.http
). With a port range, Varnish will accept connections on all ports within the range.To implement the aforementioned feature,
VSS_resolver_range()
as been added tolibvarnish
.The
Warning: mlock() of VSM failed
message is now emitted when locking of shared memory segments (viamlock(2)
) fails. As Varnish performance may be severely impacted if shared memory segments are not resident in RAM, users seeing this message are urged to review theRLIMIT_MEMLOCK
resource control as set viaulimit -l
orLimitMEMLOCK
withsystemd(1)
.A bug has been fixed where string comparisons in VCL could fail with the nonsensical error message
Comparison of different types: STRING '==' STRING
.
- An issue has been addressed in the
builtin.vcl
where backend responses would fail if they contained aContent-Range
header when no range was requested. According to RFC9110, this header should just be ignored, yet some Varnish users might prefer stricter checks. Thus, we decided to change thebuiltin.vcl
only and users hitting this issue are advised to callvcl_beresp_range
from custom VCL. - Additional
SessError
VSL events are now generated for various HTTP/2 protocol errors. Some HTTP/2 log events have been changed fromDebug
andError
toSessError
. - A new
linux
jail has been added which is now the default on Linux. For now, it is almost identical to theunix
jail with one addition: - When the new
linux
jail is used, theWorking directory not mounted on tmpfs partition
warning is now emitted if the working directory is found to reside on a file system other thantmpfs
. While other file systems are supported (and might be the right choice where administrators understand how to avoid blocking disk IO whilevarnishd
is writing to shared memory),tmpfs
is the failsafe option to avoid performance issues. - A race condition with VCL temperature transitions has been addressed, which likely caused issues with dynamic directors.
- The implementation of the
transit_buffer
has now been made the responsibility of storage engines.
Internal management of probes has been reworked to address race conditions which could cause panics with VCL temperature changes and discards (4108).
Backend tasks can now be instructed to queue if the backend has reached its
max_connections
. This allows tasks to wait for a connection to become available rather than immediately fail. This feature must be enabled through new global parameters or individual backend attributes:backend_wait_timeout
sets the amount of time a task will wait.backend_wait_limit
sets the maximum number of tasks that can wait.
These parameters can also be set for individual backends using the
wait_timeout
andwait_limit
attributes.Tasks waiting on a backend going sick (either explicitly via the
backend.set_health
command or implicitly through the probe) fail immediately.Global VSC counters have been added under
MAIN
:backend_wait
counts tasks which waited in queue for a connection.backend_wait_fail
counts tasks which waited in queue but failed becausewait_timeout
was reached or the backend went sick.
The size of the buffer to hold panic messages is now tunable through the new
panic_buffer
parameter.The Varnish Shared Memory (VSM) and Varnish Shared Counters (VSC) consumer implementation in
libvarnishapi
have been improved for stability and performance.
- An issue has been fixed where Varnish Shared Log (VSL) queries (for example
using
varnishlog -q
) with numerical values would fail in unexpected ways due to truncation. (4088) - The
ObjWaitExtend()
Object API function gained astatep
argument to optionally return the busy object state consistent with the current extension. ANULL
value may be passed if the caller does not require it. - For backends using the
.via
attribute to connect through a proxy, theconnect_timeout
,first_byte_timeout
andbetween_bytes_timeout
attributes are now inherited from proxy unless explicitly given. varnishd
now creates aworker_tmpdir
which can be used by VMODs for temporary files. The VMOD developer documentation has details.- The environment variable
VARNISH_DEFAULT_N
now provides the default "varnish name" / "workdir" as otherwise specified by he-n
argument tovarnishd
andvarnish*
utilities exceptvarnishtest
.
- An glitch with ttl comparisons has been fixed which could, for example, lead
to unexpected behavior with
purge.soft()
.
Add
h2_window_timeout
parameter to mitigate CVE-2023-43622 (VSV00014).The parameters
idle_send_timeout
andtimeout_idle
are now limited to a maximum of 1 hour.The VCL variables
bereq.connect_timeout
,bereq.first_byte_timeout
,bereq.between_bytes_timeout
,bereq.task_deadline
,sess.timeout_idle
,sess.timeout_linger
,sess.idle_send_timeout
andsess.send_timeout
can now beunset
to use their default values from parameters.Timeout and deadline parameters can now be set to a new special value
never
to apply an infinitely long timeout. Parameters which used to be of typetimeout
but do not acceptnever
have been moved to the new typeduration
. VCL variables cannot be set tonever
.The implementation of the feature flag
esi_include_onerror
changed in Varnish-Cache 7.3.0 has been reverted to more closely match the behavior before that release: By default, fragments are included again, even errors. Whenesi_include_onerror
is enabled and errors are encountered while processing an ESI fragment, processing only continues if theonerror
attribute of the<esi:include>
tag is present.Any response status other than
200
or204
counts as an error as well as any fetch error.Streaming responses may continue to be partially delivered.
Error behavior has been fixed to be consistent also for zero length fragments.
The new VSC
n_superseded
gets incremented every time an object is superseded by a new one, for example when the grace and/or keep timers kept it in cache for longer than the TTL and a fresh copy is fetched.Cache evictions of superseded objects are logged as
ExpKill
messages starting withVBF_Superseded
.The implementation of
PRIV_TASK
andPRIV_TOP
VMOD function/method arguments has been fixed to also work withstd.rollback()
(Varnish-Modules #222)Transports are now responsible for calling
VDP_Close()
in all cases.The format of
BackendClose
VSL records has been changed to use the short reason name for consistency withSessClose
.During
varnishd
shutdown, pooled backend connections are now closed bi-directionally.Mode bits of files opened via the UNIX jail as
JAIL_FIXFD_FILE
are now correctly set as0600
.The
busy_stats_rate
feature now also works for HTTP/2.The
BUILD_VMOD_$NAME
m4 macro for VMOD Makefiles has been fixed to properly support customCFLAGS
.Storage engines are now responsible for deciding which
fetch_chunksize
to use. When Varnish-Cache does not know the expected object size, it calls theobjgetspace
stevedore function with a zerosz
argument.The
Timestamp
SLT withProcess
prefix is not emitted any more when processing continues as for restarts, or whenvcl_deliver
transitions tovcl_synth
.The
FetchError
SLT withHTC
prefix now contains a verbose explanation.Varnish Test Cases (VTCs) now support an
include
statement.varnishncsa
now supports the%{Varnish:default_format}x
format to use the default format with additions.A deadlock in
VRT_AddDirector()
is now avoided with dynamic backends when the VCL goes cold.A new variable
bereq.task_deadline
, available insub vcl_pipe {}
only for now, allows to limit the total duration of pipe transactions. Its default comes from thepipe_task_deadline
parameter, which itself defaults tonever
.The VSC counters
n_expired
,n_purges
andn_obj_purged
have been fixed for purged objects.The
ExpKill
SLT prefixEXP_expire
has been renamed toEXP_Inspect
.New VSL records of the
ExpKill
SLT withEXP_Removed
are now emitted to uniformly log all "object removed from cache" events.VSL records of the
ExpKill
SLT withEXP_Expired
prefix now contain the number of hits on the removed object.A bug has been fixed in
varnishstat
where the description of the last VSC was not shown.VCL COLD events have been fixed for directors vs. VMODs: VDI COLD now comes before VMOD COLD.
The
file
storage engine now fails properly if the file size is too small.The
.happy
stevedore type method now returnstrue
if not implemented instead of panickingvarnishd
(4036)Use of
objiterate_f
on request bodies has been fixed to correctly postOBJ_ITER_END
.Use of
STV_NewObject()
has been fixed to correctly request zero bytes for attributes where only a body is to be stored.(struct req).filter_list
has been renamed tovdp_filter_list
.304 object copying has been optimized to make optimal use of storage engines' allocations.
Use of the
trimstore
storage engine function has been fixed for 304 responses.A missing
:scheme
for HTTP/2 requests is now properly handled.The
fold
flag has been added to Access Control Lists (ACLs) in VCL. When it is activated withacl ... +fold {}
, ACL entries get optimized in that subnets contained in other entries are skipped (e.g. if 1.2.3.0/24 is part of the ACL, an entry for 1.2.3.128/25 will not be added) and adjacent entries get folded (e.g. if both 1.2.3.0/25 and 1.2.3.128/25 are added, they will be folded to 1.2.3.0/24) (3563).Logging under the
VCL_acl
tag can change with this flag.Negated ACL entries are never folded.
Fixed handling of failing sub-requests: A VCL failure on the client side or the
vcl_req_reset
feature could trigger a panic, because it is not allowed to generate a minimal response. For sub-requests, we now masquerade the fail transition as a deliver and trade the illegal minimal response for the synthetic response (4022).The
param.reset [-j]
CLI command has been added to reset flags to their default. Consequently, theparam.set ... default
special value is now deprecated.The
param.set
CLI command now supports thenone
andall
values to achieve setting "absolute" values atomically as inparam.set foo none,+bar,+baz
orparam.set foo all,-bar,-baz
.A glitch in CLI command parsing has been fixed where individually quoted arguments like
"help"
were rejected.The
vcl_req_reset
feature (controllable through thefeature
parameter, see varnishd(1)) has been added and enabled by default to terminate client side VCL processing early when the client is gone.req_reset events trigger a VCL failure and are reported to vsl(7) as
Timestamp: Reset
and accounted tomain.req_reset
in vsc as visible throughvarnishstat(1)
.In particular, this feature is used to reduce resource consumption of HTTP/2 "rapid reset" attacks (see below).
Note that req_reset events may lead to client tasks for which no VCL is called ever. Presumably, this is thus the first time that valid vcl(7) client transactions may not contain any
VCL_call
records.Added mitigation options and visibility for HTTP/2 "rapid reset" attacks (CVE-2023-44487, 3996, 3997, 3998, 3999).
Global rate limit controls have been added as parameters, which can be overridden per HTTP/2 session from VCL using the new vmod
h2
:The
h2_rapid_reset
parameter andh2.rapid_reset()
function define a threshold duration for anRST_STREAM
to be classified as "rapid": If anRST_STREAM
frame is parsed sooner than this duration after aHEADERS
frame, it is accounted against the rate limit described below.The default is one second.
The
h2_rapid_reset_limit
parameter andh2.rapid_reset_limit()
function define how many "rapid" resets may be received during the time span defined by theh2_rapid_reset_period
parameter /h2.rapid_reset_period()
function before the HTTP/2 connection is forcibly closed with aGOAWAY
and all ongoing VCL client tasks of the connection are aborted.The defaults are 100 and 60 seconds, corresponding to an allowance of 100 "rapid" resets per minute.
The
h2.rapid_reset_budget()
function can be used to query the number of currently allowed "rapid" resets.Sessions closed due to rapid reset rate limiting are reported as
SessClose RAPID_RESET
in vsl(7) and accounted tomain.sc_rapid_reset
in vsc as visible throughvarnishstat(1)
.
The
cli_limit
parameter default has been increased from 48KB to 64KB.VSUB_closefrom()
now falls back to the base implementation not only ifclose_range()
was determined to be unusable at compile time, but also at run time. That is to say, even ifclose_range()
is compiled in, the fallback to the naive implementation remains.Fixed
varnishd -I
error reporting when a final newline or carriage return is missing in the CLI command file (3995).Improved and updated the build system with respect to autoconf and automake.
Improved
VSB_tofile()
error reporting, added support for partial writes and support of VSBs larger than INT_MAX.Improved HPACK header validation.
Fixed scopes of protected headers (3984).
The
VSB_quote_pfx()
(and, consequently,VSB_quote()
) function no longer produces\v
for a vertical tab. This improves compatibility with JSON.The bundled zlib has been updated to match zlib 1.3.
The
VSHA256_*
functions have been added to libvarnishapi (3946).Tabulation of the
vcl.list
CLI output has been modified slightly.VCL now supports "protected headers", which can neither be set nor unset.
The
Content-Length
andTransfer-Encoding
headers are now protected. For the common use case ofunset xxx.http.Content-Length
to dismiss a body,unset xxx.body
should be used.Error handling of numeric literals in exponent notation has been improved in the VCL compiler (3971).
Finalization of the storage private state of busy objects has been fixed. This bug could trigger a panic when
vcl_synth {}
was used to replace the object body and storage was changed from one of the built-in storage engines to a storage engine from an extension (3953).HTTP/2 header field validation is now more strict with respect to allowed characters (3952).
A bug has been fixed in the filter handling code which could trigger a panic when
resp.filters
was used fromvcl_synth {}
(3968).The utility macros
ALLOC_OBJ_EXTRA()
andALLOC_FLEX_OBJ()
have been added tominiobj.h
to simplify allocation of objects larger than a struct and such with a flexible array.The
varnishapi
version has been increased to 3.1 and the functionsVENC_Encode_Base64()
andVENC_Decode_Base64()
are now exposed.Two bugs in the ban expression parser have been fixed where one of them could lead to a panic if a ban expression with an empty header name was issued (3962).
The
v_cold
macro has been added to add__attribute__((cold))
on compilers supporting it. It is used forVRT_fail()
to mark failure code paths as cold.varnishtest
now generatesUser-Agent
request andServer
response headers with the respective client and server name by default. Thetxreq -nouseragent
andtxresp -noserver
options disable addition of these headers.Error handling of invalid header names has been improved in the VCL Compiler (3960).
A race condition has been fixed in the backend probe code which could trigger a panic with dynamic backends (dyn100).
A bug has been fixed in the ESI code which would prevent use of internal status codes >1000 as their modulus 1000 value (3958).
The
varnishd_args_prepend
andvarnishd_args_append
macros have been added tovarnishtest
to add arguments tovarnishd
invocations before and after the defaults.A bug has been fixed where
varnishd
would hang indefinitely when the worker process would not come up withincli_timeout
(3940).The
startup_timeout
parameter now specifically replacescli_timeout
for the initial startup only (3940).On Linux,
close_range()
is now used if available (3905).Error reporting has been improved if the working directory (
varnishd -n
argument) resides on a file system mountednoexec
(3943).The number of backtrace levels in panic reports has been increased from 10 to 20.
The
PTOK()
macro has been added tovas.h
to simplify error checking ofpthread_*
POSIX functions.In
varnishtest
, the basename of the test directory is now available as thevtcid
macro to serve as a unique string across concurrently running tests.In
struct vsmwseg
andstruct vsm_fantom
, theclass
member has been renamed tocategory
.ESI
onerror=abort
handling has been fixed whenmax_esi_depth
is reached (3938).A spurious Could not delete 'vcl_...' error message has been removed (3925).
A bug has been fixed where
unset bereq.body
had no effect when used with a cached body (3914).vcc
files of VMODs are now installed to/usr/share/varnish/vcc
(or equivalent) to enable re-use by other tools like code editors.The vcl-step(7) manual page has been added to document the VCL state machines.
HSH_Cancel()
has been moved toVDP_Close()
to enable transports to keep references to objects.VCL tracing now needs to be explicitly activated by setting the
req.trace
orbereq.trace
VCL variables, which are initialized from thefeature +trace
flag. Only if the trace variables are set willVCL_trace
log records be generated.Consequently,
VCL_trace
has been removed from the defaultvsl_mask
, so any trace records will be emitted by default.vsl_mask
can still be used to filterVCL_trace
records.To trace
vcl_init {}
andvcl_fini {}
, set thefeature +trace
flag while the vcl is loaded/discarded.Varnish Delivery Processors (VDPs) are now also properly closed for error conditions, avoiding potential minor memory leaks.
A regression introduced with Varnish Cache 7.3.0 was fixed: On HTTP/2 connections, URLs starting with
//
no longer trigger a protocol error (3911).Call sites of VMOD functions and methods can now be restricted to built-in subroutines using the
$Restrict
stanza in the VCC file.The counter
MAIN.http1_iovs_flush
has been added to track the number of prematurewritev()
calls due to an insufficient number of IO vectors. This number is configured through thehttp1_iovs
parameter for client connections and implicitly defined by the amount of free workspace for backend connections.Object creation failures by the selected storage engine are now logged under the
Error
tag asFailed to create object from %s %s
.The limit on the size of
varnishtest
macros has been raised to 2KB.The newly introduced abstract socket support was incompatible with other implementations, this has been fixed (3908).
The macro
WS_TASK_ALLOC_OBJ
as been added to handle the common case of allocating mini objects on a workspace.xid
variables in VCL are now of typeINT
.The new
beresp.transit_buffer
variable has been added to VCL, which defaults to the newly added parametertransit_buffer
. This variable limits the number of bytes varnish pre-fetches for uncacheable streaming fetches.Varnish now supports abstract unix domain sockets. If the operating system supports them, abstract sockets can be specified using the commonplace
@
notation for accept sockets, e.g.:varnishd -a @kandinsky
and backend paths, e.g.:
backend miro { .path = "@miro"; }
For backend requests, the timestamp from the
Last-Modified
response header is now only used to create anIf-Modified-Since
conditionalGET
request if it is at least one second older than the timestamp from theDate
header.Various interfaces of varnish's own socket address abstraction, VSA, have been changed to return or take pointers to
const
.VSA_free()
has been added.Processing of Range requests has been improved: Previously, varnish would send a 200 response with the full body when it could not reliably determine (yet) the object size during streaming.
The
debug.xid
CLI command now sets the next XID to be used, rather than "one less than the next XID to be used"VXIDs are 64 bit now and the binary format of SHM and raw saved VSL files has changed as a consequence.
The actual valid range for VXIDs is [1…999999999999999], so it fits in a VRT_INTEGER.
At one million cache-missing single request sessions per second VXIDs will roll over in a little over ten years:
(1e15-1) / (3 * 1e6 * 86400 * 365) = 10.57
That should be enough for everybody™.
You can test if your downstream log-chewing pipeline handle the larger VXIDs correctly using the CLI command:
``debug.xid 20000000000``
Consequently, VSL clients (log processing tools) are now incompatible with logs and in-memory data written by previous versions, and vice versa.
Do not ESI:include failed objects unless instructed to.
Previously, any ESI:include object would be included, no matter what the status of it were, 200, 503, didn't matter.
From now on, by default, only objects with 200 and 204 status will be included and any other status code will fail the parent ESI request.
If objects with other status should be delivered, they should have their status changed to 200 in VCL, for instance in
sub vcl_backend_error{}
,vcl_synth{}
orvcl_deliver{}
.If
param.set feature +esi_include_onerror
is used, and the<esi:include …>
tag has aonerror="continue"
attribute, any and all ESI:include objects will be delivered, no matter what their status might be, and not even a partial delivery of them will fail the parent ESI request. To be used with great caution.Backend implementations are in charge of logging their headers.
VCL backend
probe
s gained an.expect_close
boolean attribute. By setting to tofalse
, backends which fail to honorConnection: close
can be probed.Notice that the probe
.timeout
needs to be reached for a probe with.expect_close = false
to return.Support for backend connections through a proxy with a PROXY2 preamble has been added:
- VCL
backend
s gained attributes.via
and.authority
- The
VRT_new_backend_clustered()
andVRT_new_backend()
signatures have been changed
- VCL
Unused log tags (SLTs) have been removed.
Directors which take and hold references to other directors via
VRT_Assign_Backend()
(typically any director which has other directors as backends) are now expected to implement the new.release
callback of typevoid vdi_release_f(VCL_BACKEND)
. This function is called byVRT_DelDirector()
. The implementation is expected drop any backend references which the director holds (again usingVRT_Assign_Backend()
withNULL
as the second argument).Failure to implement this callback can result in deadlocks, in particular during VCL discard.
Handling of the HTTP/2 :path pseudo header has been improved.
Functions
VRT_AddVDP()
,VRT_AddVFP()
,VRT_RemoveVDP()
andVRT_RemoveVFP()
are deprecated.Cookie headers generated by vmod_cookie no longer have a spurious trailing semi-colon (
';'
) at the end of the string. This could break VCL relying on the previous incorrect behavior.The
SessClose
andBackendClose
reasonrx_body
, which previously outputFailure receiving req.body
, has been rewritten toFailure receiving body
.Prototypical Varnish Extensions (VEXT). Similar to VMODs, a VEXT is loaded by the cache process. Unlike VMODs that have the combined lifetime of all the VCLs that reference them, a VEXT has the lifetime of the cache process itself. There are no built-in extensions so far.
The VCC (compilation) process no longer loads VMODs with
dlopen(3)
to collect their metadata.Stevedore initialization via the
.init()
callback has been moved to the worker process.The parameter
tcp_keepalive_time
is supported on macOS.Duration parameters can optionally take a unit, with the same syntax as duration units in VCL. Example:
param.set default_grace 1h
.Calls to
VRT_CacheReqBody()
andstd.cache_req_body
from outside client vcl subs now fail properly instead of triggering an assertion failure (3846).New
"B"
string for the package branch inVCS_String()
. For the 7.2.0 version, it would yield the 7.2 branch.The Varnish version and branch are available in
varnishtest
through the${pkg_version}
and${pkg_branch}
macros.New
${topsrc}
macro invarnishtest -i
mode.New
process pNAME -match-text
command invarnishtest
to expect text matching a regular expression on screen.New
filewrite [-a]
command invarnishtest
to put or append a string into a file.The new
vcc_feature
bits parameter replaces previousvcc_*
boolean parameters. The latter still exist as deprecated aliases.The
-k
option fromvarnishlog
is now supported byvarnishncsa
.New functions
std.now()
andstd.timed_call()
in vmod_std.New
MAIN.shm_bytes
counter.A
req.http.via
header is set before enteringvcl_recv
. Via headers are generated using theserver.identity
value. It defaults to the host name and can be turned into a pseudonym with thevarnishd -i
option. Via headers are appended in both directions, to work with other hops that may advertise themselves.A
resp.http.via
header is no longer overwritten by varnish, but rather appended to.The
server.identity
syntax is now limited to a "token" as defined in the HTTP grammar to be suitable for Via headers.In
varnishtest
a Varnish instance will use its VTC instance name as its instance name (varnishd -i
) by default for predictable Via headers in test cases.VMOD and VEXT authors can use functions from
vnum.h
.Do not filter pseudo-headers as regular headers (VSV00009 / 3830).
The termination rules for
WRK_BgThread()
were relaxed to allow VMODs to use it.(struct worker).handling
has been moved to the newly introducedstruct wrk_vpi
and replaced by a pointer to it, as well as(struct vrt_ctx).handling
has been replaced by that pointer.struct wrk_vpi
is for state at the interface between VRT and VGC and, in particular, is not const asstruct vrt_ctx
akaVRT_CTX
.Panics now contain information about VCL source files and lines.
The
Begin
log record has a 4th field for subtasks like ESI sub-requests.The
-E
option for log utilities now works as documented, with any type of sub-task based on theBegin[4]
field. This covers ESI like before, and sub-tasks spawned by VMODs (provided that they log the new field).No more
req.http.transfer-encoding
for ESI sub-requests.New
tools/coccinelle/vcocci.sh
refactoring script for internal use.The thread pool reserve is now limited to tasks that can be queued. A backend background fetch is no longer eligible for queueing. It would otherwise slow a grace hit down significantly when thread pools are saturated.
The unused
fetch_no_thread
counter was renamed tobgfetch_no_thread
because regular backend fetch tasks are always scheduled.The macros
FEATURE()
,EXPERIMENT()
,DO_DEBUG()
,MGT_FEATURE()
,MGT_EXPERIMENT()
,MGT_DO_DEBUG()
andMGT_VCC_FEATURE()
now return a boolean value (0
or1
) instead of the (private) flag value.There is a new
contrib/
directory in the Varnish source tree. The first contribution is avarnishstatdiff
script.A regression in the transport code led MAIN.client_req to be incremented for requests coming back from the waiting list, it was fixed. (3841)
The
cookie.format_rfc1123()
function was renamed tocookie.format_date()
, and the former was retained as a deprecated alias.The VCC file
$Alias
stanza has been added to support vmod alias functions/methods.VCC now supports alias symbols.
There is a new
experimental
parameter that is identical to thefeature
parameter, except that it guards features that may not be considered complete or stable. An experimental feature may be promoted to a regular feature or dropped without being considered a breaking change.ESI includes now support the
onerror="continue"
attribute of<esi:include/>
tags.The
+esi_include_onerror
feature flag controls if the attribute is honored: If enabled, failure of an include stops ESI processing unless theonerror="continue"
attribute was set for it.The feature flag is off by default, preserving the existing behavior to continue ESI processing despite include failures.
The deprecated sub-argument of the
-l
option was removed, it is now a shorthand for thevsl_space
parameter only.The
-T
,-M
and-P
command line options can be used multiple times, instead of retaining only the last occurrence.The
debug.xid
CLI command has been extended to also set and query the VXID cache chunk size.The
vtc.barrier_sync()
VMOD function now also works invcl_init
The
abort
command in thelogexpect
facility ofvarnishtest
can now be used to trigger anabort()
to help debugging the vsl client library code.The
vtc.vsl()
andvtc.vsl_replay()
functions have been added to the vtc vmod to generate arbitrary log lines for testing.The limit of the
vsl_reclen
parameter has been corrected.Varnish now closes client connections correctly when request body processing failed.
Filter init methods of types
vdp_init_f
andvfp_init_f
gained aVRT_CTX
argument.The
param.set
CLI command accepts a-j
option. In this case the JSON output is the same asparam.show -j
of the updated parameter.A new
cc_warnings
parameter contains a subset of the compiler flags extracted fromcc_command
, which in turn grew new expansions:%d
: the raw defaultcc_command
%D
: the expanded defaultcc_command
%w
: thecc_warnings
parameter%n
: the working directory (-n
option)
For
return(pipe)
, the backend transactions now emit a Start timestamp and both client and backend transactions emit the Process timestamp.http_IsHdr()
is now exposed as part of the strict ABI for VMODs.The
req.transport
VCL variable has been added, which returns "HTTP/1" or "HTTP/2" as appropriate.The
vtc.workspace_reserve()
VMOD function now zeroes memory.Parameter aliases have been added to facilitate parameter deprecation.
Two bugs in the catflap facility have been fixed which could trigger panics due to the state pointer not being cleared. (3752, 3755)
It is now possible to assign to a
BODY
variable either aSTRING
type or aBLOB
.When the
vcl.show
CLI command is invoked without a parameter, it now defaults to the active VCL.The reporting of
logexpect
events invarnishtest
was rearranged for readability.Workspace debugging as enabled by the
+workspace
debug flag is now logged with the corresponding transaction.VMODs should now register and unregister fetch and delivery filters with
VRT_AddFilter()
andVRT_RemoveFilter()
.HSH_purge()
has been rewritten to properly handle concurrent purges on the same object head.VSL_WriteOpen()
,varnishlog
andvarnishncsa
have been changed to support writing to stdout with-w -
when not in daemon mode.In VSL, the case has been optimized that the space remaining in a buffer is close to
vsl_reclen
.std.ip()
has been changed to always return a valid (bogo ip) fallback if the fallback argument is invalid.New VCL variables
{req,req_top,resp,bereq,beresp,obj}.time
have been added to track when the respective object was born.VRT_StaticDirector()
has been added to mark directors with VCL lifetime, to avoid the overhead of reference counting.Dynamic backends are now reference-counted, and VMOD authors must explicitly track assignments with
VRT_Assign_Backend()
.Varnish will use libunwind by default when available at configure time, the
--without-unwind
configure flag can prevent this and fall back to libexecinfo to generate backtraces.A new
debug.shutdown.delay
command is available in the Varnish CLI for testing purposes.New utility macros
vmin[_t]
,vmax[_t]
andvlimit[_t]
available invdef.h
.The macros
TOSTRAND(s)
andTOSTRANDS(x, ...)
have been added to create astruct strands *
(intended to be used as aVCL_STANDS
) from a single strings
orx
strings, respectively.Note that the macros create a compound literal whose scope is the enclosing block. Their value must thus only be used within the same block (it can be passed to called functions) and must not be returned or referenced for use outside the enclosing block.
As before,
VRT_AllocStrandsWS()
orVRT_StrandsWS()
must be used to createVCL_STRANDS
with task scope for use outside the current block.A bug in the backend connection handling code has been fixed which could trigger an unwarranted assertion failure (3664).
std.strftime()
has been added.Lck_CondWait()
has lost the timeout argument and now waits forever.Lck_CondWaitUntil()
andLck_CondWaitTimeout()
have been added to wait on a condition variable until some point in time or until a timeout expires, respectively.All mutex locks in core code have been given the
PTHREAD_MUTEX_ERRORCHECK
attribute.Host
andContent-Length
header checks have been moved to protocol independent code and thus implicitly extended to HTTP2.A potential race on busy objects has been closed.
Use of the
ObjGetSpace()
for synthetic objects has been fixed to support stevedores returning less space than requested (as permitted by the API).The
FINI_OBJ()
macro has been added to standardize the common pattern of zeroing a mini object and clearing a pointer to it.The deprecated
vsm_space
parameter was removed.The
varnishtest
err_shell
commando has been removed after having been deprecated since release 5.1.0.
An assertion failure has been fixed which triggered when matching bans on non-existing headers (3706).
A VCL compilation issue has been fixed when calling builtin functions directly (3719).
It is now again possible to concatenate static strings to produce combined strings of type VCL_REGEX (3721).
An issue has been fixed that would cause the VCL dependency checker to incorrectly flag VCLs as dependents of other VCLs when using labels, preventing them from being discarded (3734).
VCLs loaded through CLI or the use of startup CLI scripts (-I option to varnishd) will, when no active VCL has previously been set, no longer automatically set the first VCL loaded to the active VCL. This prevents situations where it was possible to make a cold VCL the active VCL (3737).
There is now a configure build-time requirement on working SO_RCVTIMEO and SO_SNDTIMEO socket options.
We no longer check whether they effectively work, so the
SO_RCVTIMEO_WORKS
feature check has been removed fromvarnishtest
.The socket option inheritance checks now correctly identifies situations where UDS and TCP listening sockets behave differently, and are no longer subject to the order the inheritance checks happens to be executed (3732).
IPv6 listen endpoint address strings are now printed using brackets.
- Added convenience
vrt_null_strands
andvrt_null_blob
constants. - New VCL flag syntax
foo <name> +bar -baz { ... }
, starting with ACL flagslog
,pedantic
andtable
. - ACLs no longer produce VSL
VCL_acl
records by default, this must be explicitly enabled withacl <name> +log { ... }
. - ACLs can be compiled into a table format, which runs a little bit slower, but compiles much faster for large ACLs.
- ACLs default to
pedantic
which is now a per-ACL feature flag. - New
glob
flag for VCLinclude
(3193). - The maximum number of headers for a request or a response in
varnishtest
was increased to 64. - The backend lock class from struct backend was moved to struct director and renamed accordingly.
- New
%{sec,msec,usec,msec_frac,usec_frac}t
formats invarnishncsa
. vstrerror()
was renamed toVAS_errtxt()
.- New
varnishncsa -j
option to format for JSON (3595). - To skip a test in the presence of a feature instead of it absence, a new
feature !<name>
syntax was added tovarnishtest
. - Accept-Ranges headers are no longer generated for passed objects,
but must either come from the backend or be created in
vcl_deliver{}
(3251). - The busyobj
do_pass
flag is gone in favor ofuncacheable
. - The objcore flag ABANDON was renamed to CANCEL.
- 'Scientific Notation' numbers like 6.62607004e-34 are no longer supported in VCL. (The preparation of RFC8941 made it clear that there are neither reason nor any need to support scientific notation in context of HTTP headers.
- New
tunnel
command invarnishtest
to gain the ability to shape traffic between two peers without having to change their implementation. - Global VCL symbols can be defined after use (3555).
- New
req.hash_ignore_vary
flag in VCL. varnishtest
can register macros backed by functions, which is the case for${date}
and the brand new${string,<action>[,<args>...]}
macro (3627).- Migration to pcre2 with extensive changes to the VRE API, parameters renamed
to
pcre2_match_limit
andpcre2_depth_limit
, and the addition of a newpcre2_jit_compilation
parameter. Thevarnishtest
undocumented feature checkpcre_jit
is gone (3635). This change is transparent at the VRT layer and only affects direct VRE consumers. - New inverted mode in
vtc-bisect.sh
to find the opposite of regressions. - The default values for
workspace_client
,workspace_backend
andvsl_buffer
on 64bit systems were increased to respectively 96kB, 96kB and 16kB (3648). - The deprecated
WS_Inside()
was replaced withWS_Allocated()
andWS_Front()
was removed. - VCL header names can be quoted, for example
req.http."valid.name"
. - Added
VRT_UnsetHdr()
and removedvrt_magic_string_unset
. - Removed deprecated
STRING_LIST
in favor ofSTRANDS
. All functions that previously took aSTRING_LIST
hadconst char *, ...
arguments, they now takeconst char *, VCL_STRANDS
arguments. The magic cookievrt_magic_string_end
is gone andVRT_CollectStrands()
was renamed toVRT_STRANDS_string()
. - The default value for
thread_pool_stack
was increased to 80kB for 64bit systems and 64kB for 32bit to accomodate the PCRE2 jit compiler. - Removed deprecated
VSB_new()
andVSB_delete()
, which resulted in a major soname bump of libvarnishapi to 3.0.0, instead of the 2.7.0 version initially planned. - The default workdir (the default
-n
argument) is now/var/run
instead of${prefix}/var
(3672). Packages usually configure this to match local customs. - The minimum
session_workspace
is now 384 bytes - Emit minimal 500 response if
vcl_synth
fails (3441). - New
--enable-coverage
configure flag, and renovated sanitizer setup. - New feature checks in
varnishtest
:sanitizer
,asan
,lsan
,msan
,ubsan
andcoverage
. - New
--enable-workspace-emulator
configure flag to swap the workspace implementation with a sparse one ideal for fuzzing (3644). - Strict comparison of items from the HTTP grammar (3650).
- New request body h2 window handling using a buffer to avoid stalling an
entire h2 session until the relevant stream starts consuming DATA frames.
As a result the minimum value for
h2_initial_window_size
is now 65535B to avoid running out of buffer with a negative window that was simpler to not tolerate, and a newh2_rxbuf_storage
parameter was added (3661). SLT_Hit
now includes streaming progress when relevant.- The
http_range_support
adds consistency checks for pass transactions (3673). - New
VNUM_uint()
andVNUM_hex()
functions geared at token parsing.
Body bytes accounting has been fixed to always represent the number of bodybytes moved on the wire, exclusive of protocol-specific overhead like HTTP/1 chunked encoding or HTTP/2 framing.
This change affects counters like
MAIN.s_req_bodybytes
,MAIN.s_resp_bodybytes
,VBE.*.*.bereq_bodybytes
andVBE.*.*.beresp_bodybytes
as well as the VSL records
ReqAcct
,PipeAcct
andBereqAcct
.
VdpAcct
log records have been added to output delivery filter (VDP) accounting details analogous to the existingVfpAcct
. Both tags are masked by default.Many filter (VDP/VFP) related signatures have been changed:
vdp_init_f
vdp_fini_f
vdp_bytes_f
VDP_bytes()
as well as
struct vdp_entry
andstruct vdp_ctx
VFP_Push()
andVDP_Push()
are no longer intended for VMOD use and have been removed from the API.The VDP code is now more strict about
VDP_END
, which must be sent down the filter chain at most once.Core code has been changed to ensure for most cases that
VDP_END
gets signaled with the object's last bytes, rather than with an extra zero-data call.Reason phrases for more HTTP Status codes have been added to core code.
Connection pooling behavior has been improved with respect to
Connection: close
(3400, 3405).Handling of the
Keep-Alive
HTTP header as hop-by-hop has been fixed (3417).Handling of hop-by-hop headers has been fixed for HTTP/2 (3416).
The stevedore API has been changed:
OBJ_ITER_FINAL
has been renamed toOBJ_ITER_END
ObjExtend()
signature has been changed to also cover theObjTrimStore()
use case andObjTrimStore()
has been removed.
The
verrno.h
header file has been removed and merged intovas.h
The connection close reason has been fixed to properly report
SC_RESP_CLOSE
/resp_close
where previously onlySC_REQ_CLOSE
/req_close
was reported.Unless the new
validate_headers
feature is disabled, all newly set headers are now validated to contain only characters allowed by RFC7230. A (runtime) VCL failure is triggered if not (3407).VRT_ValidHdr()
has been added for vmods to conduct the same check as thevalidate_headers
feature, for example when headers are set by vmods using thecache_http.c
Functions likehttp_ForceHeader()
from untrusted input.The shard director now supports reconfiguration (adding/removing backends) of several instances without any special ordering requirement.
Calling the shard director
.reconfigure()
method is now optional. If not called explicitly, any shard director backend changes are applied at the end of the current task.Shard director
Error
log messages with(notice)
have been turned intoNotice
log messages.All shard
Error
andNotice
messages now use the unified prefixvmod_directors: shard %s
.In the shard director, use of parameter sets with
resolve=NOW
has been fixed.Performance of log-processing tools like
varnishlog
has been improved by usingmmap()
if possible when reading from log files.An assertion failure has been fixed which could be triggered when a request body was used with restarts (3433, 3434).
A signal handling bug in the Varnish Utility API (VUT) has been fixed which caused log-processing utilities to perform poorly after a signal had been received (3436).
The
client.identity
variable is now accessible on the backend side.Client and backend finite state machine internals (
enum req_step
andenum fetch_step
) have been removed fromcache.h
.Three new
Timestamp
VSL records have been added to backend request processing:- The
Process
timestamp afterreturn(deliver)
orreturn(pass(x))
fromvcl_backend_response
, - the
Fetch
timestamp before a backend connection is requested and - the
Connected
timestamp when a connection to a regular backend (VBE) is established, or when a recycled connection was selected for reuse.
- The
The VRT backend interface has been changed:
struct vrt_endpoint
has been added describing a UDS or TCP endpoint for a backend to connect to.Endpoints also support a preamble to be sent with every new connection.
This structure needs to be passed via the
endpoint
member ofstruct vrt_backend
when creating backends withVRT_new_backend()
orVRT_new_backend_clustered()
.
VRT_Endpoint_Clone()
has been added to facilitate working with endpoints.The variables
bereq.is_hitpass
andbereq.is_hitmiss
have been added to the backend side matchingreq.is_hitpass
andreq.is_hitmiss
on the client side.The
set_ip_tos()
function from the bundledstd
vmod now sets the IPv6 Traffic Class (TCLASS) when used on an IPv6 connection.A bug has been fixed which could lead to varnish failing to start after updates due to outdated content of the
vmod_cache
directory (3243).An issue has been addressed where using VCL with a high number of literal strings could lead to prolonged c-compiler runtimes since Varnish-Cache 6.3 (3392).
The
MAIN.esi_req
counter has been added as a statistic of the number of ESI sub requests created.The
vcl.discard
CLI command can now be used to discard more than one VCL with a single command, which succeeds only if all given VCLs could be discarded (atomic behavior).The
vcl.discard
CLI command now supports glob patterns for vcl names.The
vcl.deps
CLI command has been added to output dependencies between VCLs (because of labels andreturn(vcl)
statements).The
FetchError
log messageTimed out reusing backend connection
has been renamed tofirst byte timeout (reused connection)
to clarify that it is emit for effectively the same reason asfirst byte timeout
.Long strings in VCL can now also be denoted using
""" ... """
in addition to the existing{" ... "}
.The
pdiff()
function declaration has been moved fromcache.h
tovas.h
.The interface for private pointers in VMODs has been changed:
- The
free
pointer instruct vmod_priv
has been replaced with a pointer tostruct vmod_priv_methods
, to where the pointer to the former free callback has been moved as thefini
member. - The former free callback type has been renamed from
vmod_priv_free_f
tovmod_priv_fini_f
and as gained aVRT_CTX
argument
- The
The
MAIN.s_bgfetch
counter has been added as a statistic on the number of background fetches issues.Various improvements have been made to the
varnishtest
facility:- the
loop
keyword now works everywhere - HTTP/2 logging has been improved
- Default HTTP/2 parameters have been tweaked (3442)
- Varnish listen address information is now available by default in
the macros
${vNAME_addr}
,${vNAME_port}
and${vNAME_sock}
. Macros by the names${vNAME_SOCKET_*}
contain the address information for each listen socket as created with the-a
argument tovarnishd
. - Synchronization points for counters (VSCs) have been added as
varnish vNAME -expect PATTERN OP PATTERN
- varnishtest now also works with IPv6 setups
feature ipv4
andfeature ipv6
can be used to control execution of test cases which require one or the other protocol.- haproxy arguments can now be externally provided through the
HAPROXY_ARGS
variable. - logexpect now supports alternatives with the
expect ? ...
syntax and negative matches with thefail add ...
andfail clear
syntax. - The overall logexpect match expectation can now be inverted using
the
-err
argument. - Numeric comparisons for HTTP headers have been added:
-lt
,-le
,-eq
,-ne
,-ge
,-gt
rxdata -some
has been fixed.
- the
The
ban_cutoff
parameter now refers to the overall length of the ban list, including completed bans, where before only non-completed ("active") bans were counted towardsban_cutoff
.A race in the round-robin director has been fixed which could lead to backend requests failing when backends in the director were sick (3473).
A race in the probe management has been fixed which could lead to a panic when VCLs changed temperature in general and when
vcl.discard
was used in particular (3362).A bug has been fixed which lead to counters (VSCs) of backends from cold VCLs being presented (3358).
A bug in
varnishncsa
has been fixed which could lead to it crashing when header fields were referenced which did not exist in the processed logs (3485).For failing PROXY connections,
SessClose
now provides more detailed information on the cause of the failure.The
std.ban()
andstd.ban_error()
functions have been added to thestd
vmod, allowing VCL to check for ban errors.Use of the
ban()
built-in VCL command is now deprecated.The source tree has been reorganized with all vmods now moved to a single
vmod
directory.vmodtool.py
has been improved to simplify Makefiles when many VMODs are built in a single directory.The
VSA_getsockname()
andVSA_getpeername()
functions have been added to get address information of file descriptors.varnishd
now supports the-b none
argument to start with only the builtin VCL and no backend at all (3067).Some corner cases of IPv6 support in
varnishd
have been fixed.vcl_pipe {}
:return(synth)
and vmod private state support have been fixed. Trying to usestd.rollback()
fromvcl_pipe
now results in VCL failure (3329, 3330, 3385).The
bereq.xid
variable is now also available invcl_pipe {}
The
VRT_priv_task_get()
andVRT_priv_top_get()
functions have been added to VRT to allow vmods to retrieve existingPRIV_TASK
/PRIV_TOP
private pointers without creating any.varnishstat
now avoids display errors of gauges which previously could underflow to negative values, being displayed as extremely high positive values.The
-r
option and ther
key binding have been added to return to the previous behavior. When raw mode is active invarnishstat
interactive (curses) mode, the wordRAW
is displayed at the right hand side in the lower status line.The
VSC_IsRaw()
function has been added tolibvarnishapi
to query if a gauge is being returned raw or adjusted.The
busy_stats_rate
feature flag has been added to ensure statistics updates (as configured using thethread_stats_rate
parameter) even in scenarios where worker threads never run out of tasks and may remain forever busy.ExpKill
log (VSL) records are now masked by default. See thevsl_mask
parameter.A bug has been fixed which could lead to panics when ESI was used with ESI-aware VMODs were used because
PRIV_TOP
vmod private state was created on a wrong workspace (3496).The
VCL_REGEX
data type is now supported for VMODs, allowing them to use regular expression literals checked and compiled by the VCL compiler infrastructure.Consequently, the
VRT_re_init()
andVRT_re_fini()
functions have been removed, because they are not required and their use was probably wrong anyway.The
filter_re
,keep_re
andget_re
functions from the bundledcookie
vmod have been changed to take theVCL_REGEX
type. This implies that their regular expression arguments now need to be literal, whereas before they could be taken from some other variable or function returningVCL_STRING
.Note that these functions never actually handled _dynamic_ regexen, the string passed with the first call was compiled to a regex, which was then used for the lifetime of the respective VCL.
The
%{X}T
format has been added tovarnishncsa
, which generalizes%D
and%T
, but also support milliseconds (ms
) output.Error handling has been fixed when vmod functions/methods with
PRIV_TASK
arguments were wrongly called from the backend side (3498).The
varnishncsa
-E
argument to show ESI requests has been changed to imply-c
(client mode).Error handling and performance of the VSL (shared log) client code in
libvarnishapi
have been improved (3501).varnishlog
now supports the-u
option to write to a file specified with-w
unbuffered.Comparisons of numbers in VSL queries have been improved to match better the behavior which is likely expected by users who have not read the documentation in all detail (3463).
A bug in the ESI code has been fixed which could trigger a panic when no storage space was available (3502).
The
resp.proto
variable is now read-only as it should have been for long.VTCP_open()
has been fixed to try all possible addresses from the resolver before giving up (3509). This bug could cause confusing error messages (3510).VRT_synth_blob()
andVRT_synth_strands()
have been added. The latter should now be used instead ofVRT_synth_page()
.The
VCL_SUB
data type is now supported for VMODs to save references to subroutines to be called later usingVRT_call()
. Calls from a wrong context (e.g. calling a subroutine accessingreq
from the backend side) and recursive calls fail the VCL.See VMOD - Varnish Modules in the Reference Manual.
VMOD functions can also return theVCL_SUB
data type for calls from VCL as incall vmod.returning_sub();
.
VRT_check_call()
can be used to check if aVRT_call()
would succeed in order to avoid the potential VCL failure in case it would not.It returns
NULL
ifVRT_call()
would make the call or an error string why not.VRT_handled()
has been added, which is now to be used instead of access to thehandling
member ofVRT_CTX
.The session close reason logging/statistics for HTTP/2 connections have been improved (3393)
varnishadm
now has the-p
option to disable readline support for use in scripts and as a generic CLI connector.A log (VSL)
Notice
record is now emitted whenever more thanvary_notice
variants are encountered in the cache for a specific hash. The newvary_notice
parameter defaults to 10.The modulus operator
%
has been added to VCL.return(retry)
fromvcl_backend_error {}
now correctly resetsberesp.status
andberesp.reason
(3525).Handling of the
gunzip
filter with ESI has been fixed (3529).A bug where the
threads_limited
counter could be increased without reason has been fixed (3531).All varnish tools using the VUT library utilities for argument processing now support the
--optstring
argument to return a string suitable for use withgetopts
from shell scripts.An issue with high CPU consumption when the maximum number of threads was reached has been fixed (2942, 3531)
HTTP/2 streams are now reset for filter chain (VDP) errors.
The task priority of incoming connections has been fixed.
An issue has been addressed where the watchdog facility could misfire when tasks are queued.
The builtin VCL has been reworked: VCL code has been split into small subroutines, which custom VCL can prepend custom code to.
This allows for better integration of custom VCL and the built-in VCL and better reuse.
- Bump the VRT_MAJOR_VERSION from 11 to 12, to reflect the API changes that went into the 6.5.0 release. This step was forgotten for that release.
[ABI] marks potentially breaking changes to binary compatibility.
[API] marks potentially breaking changes to source compatibility (implies [ABI]).
varnishstat
now has a help screen, available via theh
key in curses modeThe initial
varnishstat
verbosity has been changed to ensure any fields specified by the-f
argument are visible (2990)Fixed handling of out-of-workspace conditions after
vcl_backend_response
andvcl_deliver
during filter initialization (3253, 3241)PRIV_TOP
is now thread-safe to support parallel ESI implementationsvarnishstat
JSON format (-j
option) has been changed:on the top level, a
version
identifier has been introduced, which will be used to mark future breaking changes to the JSON formatting. It will not be used to mark changes to the counters themselves.The new
version
is1
.All counters have been moved down one level to the
counters
object.
VSA_BuildFAP()
has been added as a convenience function to build astruct suckaddr
Depending on the setting of the new
vcc_acl_pedantic
parameter, VCC now either emits a warning or fails if network numbers used in ACLs do not have an all-zero host part.For
vcc_acl_pedantic
off, the host part is fixed to all-zero and that fact logged with theACL
VSL tag.Fixed error handling during object creation after
vcl_backend_response
(3273)obj.can_esi
has been added to identify if the response can be ESI processed (3002)resp.filters
now contains a correct value when the auto-determined filter list is read (3002)It is now a VCL (runtime) error to write to
resp.do_*
andberesp.do_*
fields which determine the filter list after settingresp.filters
andberesp.filters
, respectivelyBehavior for 304 responses was changed not to update the
Content-Encoding
response header of the stored object.[ABI]
struct vfp_entry
andstruct vdp_ctx
changed[API] VSB_QUOTE_GLOB, which was prematurely added to 6.4, has been removed again.
[API] Add
VDP_END
action for delivery processors, which has to be sent with or after the last buffer.Respect the administrative health for "real" (VBE) backends (3299)
Fixed handling of illegal (internal) four-digit response codes and with HTTP/2 (3301)
Fixed backend connection pooling of closed connections (3266)
Added the
.resolve
method for theBACKEND
type to resolve (determine the "real" backend) a director.Improved
vmodtool
support for out-of-tree buildsAdded
VJ_unlink()
andVJ_rmdir()
jail functionsFixed workdir cleanup (3307)
Added
JAIL_MASTER_SYSTEM
jail levelThe Varnish Jail (least privileges) code for Solaris has been largely rewritten. It now reduces privileges even further and thus should improve the security of Varnish on Solaris even more.
The Varnish Jail for Solaris now accepts an optional
worker=
argument which allows to extend the effective privilege set of the worker process.The shard director and shard director parameter objects should now work in
vcl_pipe {}
like invcl_backend_* {}
subs.For a failure in
vcl_recv {}
, the VCL state engine now returns right after return from that subroutine. (3303)The shard director now supports weights by scaling the number of replicas of each backend on the consistent hashing ring
Fixed a race in the cache expiry code which could lead to a panic (2999)
Added
VRE_quote()
to facilitate building literal string matches with regular expressions.The
BackendReuse
VSL (log) tag has been retired and replaced withBackendClose
, which has been changed to contain eitherclose
orrecycle
to signify whether the connection was closed or returned to a pool for later reuse.BackendOpen
VSL entries have been changed to containreuse
orconnect
in the last column to signify whether the connection was reused from a pool or newly opened.std.rollback()
of backend requests withreturn(retry)
has been fixed (3353)FetchError
logs now differentiate betweenNo backend
and "none resolved" asDirector %s returned no backend
Added
VRT_DirectorResolve()
to resolve a directorImproved VCC handling of symbols and, in particular, type methods
Fixed use of the shard director from
vcl_pipe {}
(3361)Handle recursive use of vcl
include
(3360)VCL: Added native support for BLOBs in structured fields notation (
:<base64>:
)Fixed handling of the
Connection:
header when multiple instances of the named headers existed.Added support for naming
PRIV_
arguments to vmod methods/functionsThe varnish binary heap implementation has been renamed to use the
VBH_
prefix, complemented with a destructor and added to header files for use with vmods (via include ofvbh.h
).A bug in
vmod_blob
for base64 decoding with alength
argument and non-padding decoding has been fixed (3378)Added
VRT_BLOB_string()
tovrt.h
VSB support for dynamic vs. static allocations has been changed:
For dynamic allocations use:
VSB_new_auto() + VSB_destroy()
For preexisting buffers use:
VSB_init() + VSB_fini()
VSB_new()
+VSB_delete()
are now deprecated.std.blobread()
has been addedNew
MAIN.beresp_uncacheable
andMAIN.beresp_shortlived
counters have been added.The
I
,X
andR
arguments have been added to the VSC API andvarnishstat
for inclusion, exclusion and required glob patterns on the statistic field names. (3394)- Added the missing
VSC_OPT_f
macro and the newVSC_OPT_I
andVSC_OPT_X
to libvarnishapi headers. - Added
-I
and-X
options tovarnishstat
.
- Added the missing
Overhaul of the workspace API
- The previously deprecated
WS_Reserve()
has been removed - The signature of
WS_Printf()
has been changed to returnconst char *
instead ofvoid *
(we do not consider this a breaking change). - Add
WS_ReservationSize()
WS_Front()
is now deprecated and replaced byWS_Reservation()
- The previously deprecated
Handle a workspace overflow in
VRY_Validate()
(3319)Fixed the backend probe
.timeout
handling for "dripping" responses (3402)New
VARNISH_VMODS_GENERATED()
macro invarnish.m4
.Prevent pooling of a
Connection: close
backend response.When this header is present, be it sent by the backend or added in
vcl_backend_response {}
, varnish closes the connection after the current request. (3400)
The
MAIN.sess_drop
counter is gone.New configure switch: --with-unwind. Alpine linux appears to offer a
libexecinfo
implementation that crashes when called by Varnish, this offers the alternative of usinglibunwind
instead.backend
none
was added for "no backend".std.rollback(bereq)
is now safe to use, fixed bug 3009Fixed
varnishstat
,varnishtop
,varnishhist
andvarnishadm
handling INT, TERM and HUP signals (bugs 3088 and 3229)The hash algorithm of the
hash
director was changed, so backend selection will change once only when upgrading. Users of thehash
director are advised to consider using theshard
director, which, amongst other advantages, offers more stable backend selection through consistent hashing.Log records can safely have empty fields or fields containing blanks if they are delimited by "double quotes". This was applied to
SessError
andBackend_health
.It is now possible for VMOD authors to customize the connection pooling of a dynamic backend. A hash is now computed to determine uniqueness and a backend declaration can contribute arbitrary data to influence the pool.
The option
varnishtest -W
is gone, the same can be achieved withvarnishtest -p debug=+witness
. Awitness.sh
script is available in the source tree to generate a graphviz dot file and detect potential lock cycles from the test logs.The
Process
timestamp forvcl_synth {}
was wrongly issued before the VCL subroutine, now it gets emitted after VCL returns for consistency withvcl_deliver {}
.Latencies for newly created worker threads to start work on congested systems have been improved.
VRB_Iterate()
signature has changedVRT_fail()
now also works from director codeDeliberately closing backend requests through
return(abandon)
,return(fail)
orreturn(error)
is no longer accounted as a fetch failureFixed a bug which could cause probes not to run
The
if-range
header is now handled, allowing clients to conditionally request a range based on a date or an ETag.Introduced
struct reqtop
to hold information on the ESI top request andPRIV_TOP
, fixed regression 3019Allow numerical expressions in VCL to be negative / negated
Add vi-stype CTRL-f / CTRL-b for page down/up to interactive varnishstat
Fixed wrong handling of an out-of-workspace condition in the proxy vmod and in the workspace allocator, bug 3131
Raised the minimum for the
vcl_cooldown
parameter to 1s to fix bug 3135Improved creation of additional threads when none are available
Fixed a race between director creation and the
backend.list
CLI command - see bug 3094Added error handling to avoid panics for workspace overflows during session attribute allocation - bug 3145
Overloaded the
+=
operator to also append to headersFixed set
*.body
commands.Fixed status for truncated CLI responses, bug 3038
New or improved Coccinelle semantic patches that may be useful for VMOD or utilities authors.
Output VCC warnings also for VCLs loaded via the
varnishd -f
option, see bug 3160Improved fetch error handling when stale objects are present in cache, see bug 3089
Added a
Notice
VSL tag (used forvarnishlog
logging)Always refer to
sub
as subroutine in the documentation and error messages to avoid confusion with other terms.New
pid
command in the Varnish CLI, to get the master and optionally cache process PIDs, for example fromvarnishadm
.Fixed a race that could result in a partial response being served in its entirety when it is also compressed with gzip.
Fixed session close reason reporting and accounting, added
rx_close_idle
counter for separate accounting whentimeout_idle
is reached. Also,send_timeout
is no longer reported as "remote closed".Fixed handling of request bodies for backend retries
Fix deadlocks when the maximum number of threads has been reached, in particular with http/2, see 2418
Add more vcl control over timeouts with
sess.timeout_linger
,sess.send_timeout
andsess.idle_send_timeout
Fix panics due to missing EINVAL handling on macOS, see 1853
Added
VSLs()
andVSLbs()
functions for loggingSTRANDS
to VSLFixed cases where a workspace overflow would not result in a VCL failure, see 3194
Added
WS_VSB_new()
/WS_VSB_finish()
for VSBs on workspacesImported
vmod_cookie
from varnish_modulesThe previously deprecated function
cookie.filter_except()
has been removed during import. It was replaced bycookie.keep()
body_status
andreq_body_status
have been collapsed into one type. In particular, theREQ_BODY_*
enums now have been replaced withBS_*
.
Fixed an old regression of the
Age:
header for passes, see bug 3221Added
VRT_AllocStrandsWS()
as a utility function to allocate STRANDS on a workspace.Reduced compile time of
vcl_init{}
/vcl_fini{}
with gcc, addedv_dont_optimize
attribute macroFixed a case where
send_timeout
would have no effect when streaming from a backend fetch, see bug 3189NOTE Users upgrading varnish should re-check
send_timeout
with respect to long pass and streaming fetches and watch out for increased session close rates.Added
VSB_tofile()
tolibvarnishapi
, see 3238
In addition to a significant number of bug fixes, these are the most important changes in 6.3:
- The Host: header is folded to lower-case in the builtin_vcl.
- Improved performance of shared memory statistics counters.
- Synthetic objects created from
vcl_backend_error {}
now replace existing stale objects as ordinary backend fetches would, unless:- abandoning the bereq or
- leaving
vcl_backend_error {}
withreturn (deliver) and ``beresp.ttl == 0s
or - there is a waitinglist on the object, in which case, by default,
the synthetic object is created with
ttl = 1s
/grace = 5s
/keep = 5s
avoid hammering on failing backends (note this is existing behavior).
- Retired the
BackendStart
log tag -BackendOpen
contains all the information from it
WS_Reserve()
is now deprecated and any use should trigger a compiler warning. It is to be replaced byWS_ReserveAll()
to reserve all of the remaining workspaceIt will always leave the workspace reserved even if 0 bytes are available, so it must always be followed by a call to
WS_Release()
WS_ReserveSize()
to reserve a fixed amount.It will only leave the workspace reserved if the reservation request could be fulfilled.
We provide a script to help automate this change in the
tools/coccinelle
subdirectory of the source tree.The RST references generated by
vmodtool.py
have been changed to match better the VCL syntax to avoid overhead where references are used. The new scheme for a vmod called name is:$Function
: name.function()$Object
constructor: name.object()$Method
: xobject.method()
To illustrate, the old references:
:ref:`vmod_name.function` :ref:`vmod_name.obj` :ref:`vmod_name.obj.method`
now are renamed to:
:ref:`name.function()` :ref:`name.obj()` :ref:`xobj.method()`
tools/vmod_ref_rename.sh
is provided to automate this task
Extend JSON support in the CLI (2783)
Improve accuracy of statistics (VSC)
In
Error: out of workspace
log entries, the workspace name is now reported in lowercaseAdjust code generator python tools to python 3 and prefer python 3 over python 2 where available
Added a thread pool watchdog which will restart the worker process if scheduling tasks onto worker threads appears stuck. The new parameter
thread_pool_watchdog
configures it. (2418)Changed
ExpKill
log tags to emit microsecond-precision timestamps instead of nanoseconds (2792)Changed the default of the
thread_pool_watchdog
parameter to 60 seconds to match thecli_timeout
defaultVSB quoted output has been unified to three-digit octal, VSB_QUOTE_ESCHEX has been added to prefer hex over octal quoting
Retired long deprecated parameters (VIP16). Replacement mapping is:
shm_reclen
->vsl_reclen
vcl_dir
->vcl_path
vmod_dir
->vmod_path
The width of the columns of the
backend.list
cli command output is now dynamic.For best forward compatibility, we recommend that scripts parse JSON output as obtained using the
-j
option.See release notes for details.
The format of the
backend.list -j
(JSON) cli command output has changed.See release notes for details.
The undocumented
-v
option to thebackend.list
cli command has been removedChanged the formatting of the
vcl.list
command from:status state/temperature busy name [labelinfo]
to:
status state temperature busy name [<-|->] [info]
Column width is now dynamic.
Field values remain unchanged except for the label information, see varnish-cli(7) for details.
The ban facility has been extended by bans access to obj.ttl, obj.age, obj.grace and obj.keep and additional inequality operators.
Many cache lookup optimizations.
Display the VCL syntax during a panic.
Update to the VCL diagrams to include hit-for-miss.
- Added
req.is_hitmiss
andreq.is_hitpass
(2743)
- Added
directors.lookup()
Improved varnish log client performance (2788)
For
varnishtest -L
, also keep VCL C source filesAdd
param.reset
command tovarnishadm
Add VSL rate limiting (2837)
This adds rate limiting to varnishncsa and varnishlog.
Make it possible to change
varnishstat
update rate. (2741)
libvarnish
:VRT_VSA_GetPtr
renamed toVSA_GetPtr
Included
vtree.h
in the distribution for vmods and renamed the red/black tree macros fromVRB_*
toVRBT_*
to disambiguate from the acronym for Varnish Request Body.Changed the internal organisation of dynamic PRIVs (
PRIV_TASK
,PRIV_TOP
from a list to a red/black tree) for performance. (2813)Vmod developers are advised that anything returned by a vmod function/method is assumed to be immutable. In other words, a vmod must not modify any data which was previously returned.
Tolerate null IP addresses for ACL matches.
Added
vstrerror()
as a safe wrapper forstrerror()
to avoid a NULL pointer dereference under rare conditions where the latter could return NULL. (2815)Varnish-based tools using the VUT interface should now consider using the
VUT_Usage()
function for consistencyThe name of the event_function callback for VCL events in vmods is now prefixed by $Prefix
_
` if $Prefix is defined in the.vcc
file, orvmod_
by default.So, for example, with
$Event foo
and no $Prefix, the event function will be calledvmod_foo
and with$Prefix bar
it will be calledbar_foo
.In the vmodtool-generated ReStructuredText documentation, anchors have been renamed
- from
obj_
class to vmodname.
class for constructors and - from
func_
class to vmodname.
function for functions and - from
func_
class to vmodname.
class.
method for methods,
respectively. In short, the anchor is now named equal to VCL syntax for constructors and functions and similarly to VCL syntax for methods.
- from
VRT API has been updated to 9.0
HTTP_Copy()
was removed,HTTP_Dup()
andHTTP_Clone()
were addedPreviously,
VCL_BLOB
was implemented asstruct vmod_priv
, which had the following shortcomings:- blobs are immutable, but that was not reflected by the
priv
pointer - the existence of a free pointer suggested automatic memory management, which did never and will not exist for blobs.
The
VCL_BLOB
type is now implemented asstruct vrt_blob
, with theblob
member replacing the formerpriv
pointer and thefree
pointer removed.A
type
member was added for lightweight type checking similar to the miniobjectmagic
member, but in contrast to it,type
should never be asserted upon.VRT_blob()
was updated accordingly.- blobs are immutable, but that was not reflected by the
req->req_bodybytes
was removed. Replacement code snippet:AZ(ObjGetU64(req->wrk, req->body_oc, OA_LEN, &u));
VRT_SetHealth()
has been removed andVRT_SetChanged()
added.VRT_LookupDirector()
(only to be called from CLI contexts) as been added.See release notes for details
vmodtool has been changed significantly to avoid various name clashes. Rather than using literal prefixes/suffixes, vmod authors should now (and might have to for making existing code continue to compile) use the following macros
VPFX(name)
to prepend the vmod prefix (vmod_
by default)VARGS(name)
as the name of a function/method's argument struct, e.g.:VCL_VOID vmod_test(VRT_CTX, struct VARGS(test) *args) { ...
VENUM(name)
to access the enum by the name name
- Fixed
varnishhist
display error (2780) - Fix
varnishstat -f
in curses mode (interactively, without-1
, 2787) - Handle an out-of-workspace condition in HTTP/2 delivery more gracefully (2589)
- Fixed regression introduced just before 6.1.0 release which caused an unnecessary incompatibility with VSL files written by previous versions. (2790)
- Fix warmup/rampup of the shard director (2823)
- Fix VRT_priv_task for calls from vcl_pipe {} (2820)
- Fix assigning <bool> == <bool> (2809)
- Fix vmod object constructor documentation in the
vmodtool.py
- generated RST files - Fix some stats metrics (vsc) which were wrongly marked as _gauge_
- Fix
varnishd -I
(2782) - Add error handling for STV_NewObject() (2831)
- Fix VRT_fail for 'if'/'elseif' conditional expressions (2840)
- Added -p max_vcl and -p max_vcl_handling for warnings/errors when there are too many undiscarded VCL instances. (2713)
Content-Length
header is not rewritten in response to a HEAD request, allows responses to HEAD requests to be cached independently from GET responses.
return(fail("mumble"))
can have a string argument that is emitted by VCC as an error message if the VCL load fails due to the return. (2694)- Improved VCC error messages (2696)
- Fixed
obj.hits
invcl_hit
(had been always 0) (2746) - req.ttl is fully supported again
varnishhist
: Improved test coveragevarnishtest
: Added haproxy CLI send/expect facility
- libvarnishapi so version bumped to 2.0.0 (2718)
- For VMOD methods/functions with PRIV_TASK or PRIV_TOP arguments, the struct vrt_priv is allocated on the appropriate workspace. In the out-of-workspace condition, VCL failure is invoked, and the VMOD method/function is not called. (2708)
- Improved support for the VCL STRANDS type, VMOD blob refactored to use STRANDS (2745)
- A series of bug fixes related to excessive object accumulation and Transient storage use in the hit-for-miss case (2760, 2754, 2654, 2763)
- A series of fixes related to Python and the vmodtool (2761, 2759, 2742)
- UB in varnishhist (2773)
- Allow to not have randomness in file_id (2436)
- b64.vtc unstable (2753)
- VCL_Poll ctx scope (2749)
- Added std.fnmatch() (2737)
- The variable req.grace is back. (2705)
- Importing the same VMOD multiple times is now allowed, if the file_id is identical.
The counters
sess_fail_econnaborted
sess_fail_eintr
sess_fail_emfile
sess_fail_ebadf
sess_fail_enomem
sess_fail_other
now break down the detailed reason for session accept failures, the sum of which continues to be counted in
sess_fail
.
- VMOD unix now supports the
getpeerucred(3)
case.
varnishhist
: The format of the-P
argument has been changed for custom profile definitions to also contain a prefix to match the tag against.varnishtest
: syslog instances now have to start with a capital S.
- When an object is out of grace but in keep, the client context goes straight to vcl_miss instead of vcl_hit. The documentation has been updated accordingly. (2705)
- Several H2 bugs (2285, 2572, 2623, 2624, 2679, 2690, 2693)
- Make large integers work in VCL. (2603)
- Print usage on unknown or missing arguments (2608)
- Assert error in VPX_Send_Proxy() with proxy backends in pipe mode (2613)
- Holddown times for certain backend connection errors (2622)
- Enforce Host requirement for HTTP/1.1 requests (2631)
- Introduction of '-' CLI prefix allowed empty commands to sneak through. (2647)
- VUT apps can be stopped cleanly via vtc process -stop (2649, 2650)
- VUT apps fail gracefully when removing a PID file fails
- varnishd startup log should mention version (2661)
- In curses mode, always filter in the counters necessary for the header lines. (2678)
- Assert error in ban_lurker_getfirst() (2681)
- Missing command entries in varnishadm help menu (2682)
- Handle string literal concatenation correctly (2685)
- varnishtop -1 does not work as documented (2686)
- Handle sigbus like sigsegv (2693)
- Panic on return (retry) of a conditional fetch (2700)
- Wrong turn at cache/cache_backend_probe.c:255: Unknown family (2702, 2726)
- VCL failure causes TASK_PRIV reference on reset workspace (2706)
- Accurate ban statistics except for a few remaining corner cases (2716)
- Assert error in vca_make_session() (2719)
- Assert error in vca_tcp_opt_set() (2722)
- VCL compiling error on parenthesis (2727)
- Assert error in HTC_RxPipeline() (2731)
Fixed implementation of the
max_restarts
limit: It used to be one less than the number of allowed restarts, it now is the number ofreturn(restart)
calls per request.The
cli_buffer
parameter has been removedAdded back
umem
storage for Solaris descendantsThe new storage backend type (stevedore)
default
now resolves to eitherumem
(where available) ormalloc
.Since varnish 4.1, the thread workspace as configured by
workspace_thread
was not used as documented, delivery also used the client workspace.We are now taking delivery IO vectors from the thread workspace, so the parameter documentation is in sync with reality again.
Users who need to minimize memory footprint might consider decreasing
workspace_client
byworkspace_thread
.The new parameter
esi_iovs
configures the amount of IO vectors used during ESI delivery. It should not be tuned unless advised by a developer.Support Unix domain sockets for the
-a
and-b
command-line arguments, and for backend declarations. This requires VCL >= 4.1.
return (fetch)
is no longer allowed invcl_hit {}
, usereturn (miss)
instead. Note thatreturn (fetch)
has been deprecated since 4.0.Fix behaviour of restarts to how it was originally intended: Restarts now leave all the request properties in place except for
req.restarts
andreq.xid
, which need to change by design.req.storage
,req.hash_ignore_busy
andreq.hash_always_miss
are now accessible from all of the client side subs, not justvcl_recv{}
obj.storage
is now available invcl_hit{}
andvcl_deliver{}
.Removed
beresp.storage_hint
for VCL 4.1 (was deprecated since Varnish 5.1)For VCL 4.0, compatibility is preserved, but the implementation is changed slightly:
beresp.storage_hint
is now referring to the same internal data structure asberesp.storage
.In particular, it was previously possible to set
beresp.storage_hint
to an invalid storage name and later retrieve it back. Doing so will now yield the last successfully set stevedore or the undefined (NULL
) string.IP-valued elements of VCL are equivalent to
0.0.0.0:0
when the connection in question was addressed as a UDS. This is implemented with thebogo_ip
invsa.c
.beresp.backend.ip
is retired as of VCL 4.1.workspace overflows in
std.log()
now trigger a VCL failure.workspace overflows in
std.syslog()
are ignored.added
return(restart)
fromvcl_recv{}
.The
alg
argument of theshard
director.reconfigure()
method has been removed - the consistent hashing ring is now always generated using the last 32 bits of a SHA256 hash of"ident%d"
as withalg=SHA256
or the default.We believe that the other algorithms did not yield sufficiently dispersed placement of backends on the consistent hashing ring and thus retire this option without replacement.
Users of
.reconfigure(alg=CRC32)
or.reconfigure(alg=RS)
be advised that when upgrading and removing thealg
argument, consistent hashing values for all backends will change once and only once.The
alg
argument of theshard
director.key()
method has been removed - it now always hashes its arguments using SHA256 and returns the last 32 bits for use as a shard key.Backwards compatibility is provided through vmod blobdigest with the
key_blob
argument of theshard
director.backend()
method:for
alg=CRC32
, replace:<dir>.backend(by=KEY, key=<dir>.key(<string>, CRC32))
with:
<dir>.backend(by=BLOB, key_blob=blobdigest.hash(ICRC32, blob.decode(encoded=<string>)))
Note: The vmod blobdigest hash method corresponding to the shard director CRC32 method is called ICRC32
for
alg=RS
, replace:<dir>.backend(by=KEY, key=<dir>.key(<string>, RS))with:
<dir>.backend(by=BLOB, key_blob=blobdigest.hash(RS, blob.decode(encoded=<string>)))
The
shard
director now offers resolution at the time the actual backend connection is made, which is how all other bundled directors work as well: With theresolve=LAZY
argument, other shard parameters are saved for later reference and a director object is returned.This enables layering the shard director below other directors.
The
shard
director now also supports getting other parameters from a parameter set object: Rather than passing the required parameters with each.backend()
call, an object can be associated with a shard director defining the parameters. The association can be changed invcl_backend_fetch()
and individual parameters can be overridden in each.backend()
call.The main use case is to segregate shard parameters from director selection: By associating a parameter object with many directors, the same load balancing decision can easily be applied independent of which set of backends is to be used.
To support parameter overriding, support for positional arguments of the shard director
.backend()
method had to be removed. In other words, all parameters to the shard director.backend()
method now need to be named.Integers in VCL are now 64 bits wide across all platforms (implemented as
int64_t
C type), but due to implementation specifics of the VCL compiler (VCC), integer literals' precision is limited to that of a VCL real (double
C type, roughly 53 bits).In effect, larger integers are not represented accurately (they get rounded) and may even have their sign changed or trigger a C compiler warning / error.
Add VMOD unix.
Add VMOD proxy.
- Turned off PROXY protocol debugging by default, can be enabled with
the
protocol
debug flag. - added
cache_hit_grace
statistics counter. - added
n_lru_limited
counter. - The byte counters in ReqAcct now show the numbers reported from the operating system rather than what we anticipated to send. This will give more accurate numbers when e.g. the client hung up early without receiving the entire response. Also these counters now show how many bytes was attributed to the body, including any protocol overhead (ie chunked encoding).
varnishncsa
refuses output formats (as defined with the-F
command line argument) for tags which could contain control or binary characters. At the time of writing, these are:%{H2RxHdr}x
,%{H2RxBody}x
,%{H2TxHdr}x
,%{H2TxBody}x
,%{Debug}x
,%{HttpGarbage}x
and%{Hash}x
- The vtc
server -listen
command supports UDS addresses, as does theclient -connect
command. vtcremote.path
andremote.port
have the values0.0.0.0
and0
when the peer address is UDS. Addedremote.path
to vtc, whose value is the path when the address is UDS, and NULL (matching <undef>) for IP addresses.
- We have now defined three API Stability levels:
VRT
,PACKAGE
,SOURCE
. - New API namespace rules, see phk_api_spaces_
- Rules for including API headers have been changed:
* many headers can now only be included once
* some headers require specific include ordering
* only
cache.h
_or_vrt.h
can be included - Signatures of functions in the VLU API for bytestream into text serialization have been changed
- vcl.h now contains convenience macros
VCL_MET_TASK_B
,VCL_MET_TASK_C
andVCL_MET_TASK_H
for checkingctx->method
for backend, client and housekeeping (vcl_init/vcl_fini) task context - vcc files can now contain a
$Prefix
stanza to define the prefix for vmod function names (which was fixed tovmod
before) - vcc files can contain a
$Synopsis
stanza with one of the valuesauto
ormanual
, defaultauto
. Withauto
, a more comprehensive SYNOPSIS is generated in the doc output with an overview of objects, methods, functions and their signatures. Withmanual
, the auto-SYNOPSIS is left out, for VMOD authors who prefer to write their own. - All Varnish internal
SHA256*
symbols have been renamed toVSHA256*
- libvarnish now has
VNUM_duration()
to convert from a VCL duration like 4h or 5s - director health state queries have been merged to
VRT_Healthy()
- Renamed macros:
*
__match_proto__()
->v_matchproto_()
*__v_printflike()
->v_printflike_()
*__state_variable__()
->v_statevariable_()
*__unused
->v_unused_
*__attribute__((__noreturn__)
->v_noreturn_
- ENUMs are now fixed pointers per vcl.
- Added
VRT_blob()
utility function to create a blob as a copy of some chunk of data on the workspace. - Directors now have their own admin health information and always need to
have the
(struct director).admin_health
initialized toVDI_AH_*
(usuallyVDI_AH_HEALTHY
).
PRIV_*
function/method arguments are not excluded from auto-generated vmod documentation.
- After reusing a backend connection fails once, a fresh connection will be opened (2135).
- Honor first_byte_timeout for recycled backend connections. (1772)
- Limit backend connection retries to a single retry (2135)
- H2: Move the req-specific PRIV pointers to struct req. (2268)
- H2: Don't panic if we reembark with a request body (2305)
- Clear the objcore attributes flags when (re)initializing an stv object. (2319)
- H2: Fail streams with missing :method or :path. (2351)
- H2: Enforce sequence requirement of header block frames. (2387)
- H2: Hold the sess mutex when evaluating r2->cond. (2434)
- Use the idle read timeout only on empty requests. (2492)
- OH leak in http1_reembark. (2495)
- Fix objcore reference count leak. (2502)
- Close a race between backend probe and vcl.state=Cold by removing the be->vsc under backend mtx. (2505)
- Fail gracefully if shard.backend() is called in housekeeping subs (2506)
- Fix issue #1799 for keep. (2519)
- oc->last_lru as float gives too little precision. (2527)
- H2: Don't HTC_RxStuff with a non-reserved workspace. (2539)
- Various optimizations of VSM. (2430, 2470, 2518, 2535, 2541, 2545, 2546)
- Problems during late socket initialization performed by the Varnish child process can now be reported back to the management process with an error message. (2551)
- Fail if ESI is attempted on partial (206) objects.
- Assert error in ban_mark_completed() - ban lurker edge case. (2556)
- Accurate byte counters (2558). See Logging / statistics above.
- H2: Fix reembark failure handling. (2563 and 2592)
- Working directory permissions insufficient when starting with umask 027. (2570)
- Always use HTTP/1.1 on backend connections for pass & fetch. (2574)
- EPIPE is a documented errno in tcp(7) on linux. (2582)
- H2: Handle failed write(2) in h2_ou_session. (2607)
- 2429 - Avoid buffer read overflow on vcl_backend_error and -sfile
- 2492 - Use the idle read timeout only on empty requests.
- The
cli_buffer
parameter has been deprecated (2382)
- The default for the -i argument is now the hostname as returned by gethostname(3)
- Where possible (on platforms with setproctitle(3)), the -i argument rather than the -n argument is used for process names
- varnishd -f honors
vcl_path
(#2342) - The
MAIN.s_req
statistic has been removed, as it was identical toMAIN.client_req
. VSM consumers should be changed to use the latter if necessary. - A listen address can take a name in the -a argument. This name is used in the logs and later will possibly be available in VCL.
- VRT_purge fails a transaction if used outside of
vcl_hit
andvcl_miss
(#2339) - Added
bereq.is_bgfetch
which is true for background fetches. - Added VMOD purge (#2404)
- Added VMOD blob (#2407)
- The VSM API for accessing the shared memory segment has been totally rewritten. Things should be simpler and more general.
- VSC shared memory layout has changed and the VSC API updated to match it. This paves the way for user defined VSC counters in VMODS and later possibly also in VCL.
- New vmod vtc for advanced varnishtest usage (#2276)
- 2379 - Correctly handle bogusly large chunk sizes (VSV00001)
- Fix an endless loop in Backend Polling (#2295)
- Fix a Chunked bug in tight workspaces (#2207, #2275)
- Fix a bug relating to req.body when on waitinglist (#2266)
- Handle EPIPE on broken TCP connections (#2267)
- Work around the x86 arch's turbo-double FP format in parameter setup code. (#1875)
- Fix race related to backend probe with proxy header (#2278)
- Keep VCL temperature consistent between mgt/worker also when worker protests.
- A lot of HTTP/2 fixes.
- Fix bug introduced by stubborn old bugger right before release 5.1.0 was cut.
- Added varnishd command-line options -I, -x and -?, and tightened restrictions on permitted combinations of options.
- More progress on support for HTTP/2.
- Add
return(fail)
to almost all VCL subroutines. - Restored the old hit-for-pass, invoked with
return(pass(DURATION))
fromvcl_backend_response
. hit-for-miss remains the default. Added the cache_hitmiss stat, and cache_hitpass only counts the new/old hit-for-pass cases. Restored HitPass to the Varnish log, and added HitMiss. Added the HFP prefix to TTL log entries to log a hit-for-pass duration. - Rolled back the fix for #1206. Client delivery decides solely whether to send a 304 client response, based on client request and response headers.
- Added vtest.sh.
- Added vxid as a lefthand side for VSL queries.
- Added the setenv and write_body commands for Varnish test cases (VTCs). err_shell is deprecated. Also added the operators -cliexpect, -match and -hdrlen, and -reason replaces -msg. Added the ${bad_backend} macro.
- varnishtest can be stopped with the TERM, INT and KILL signals, but not with HUP.
- The fallback director has now an extra, optional parameter to keep using the current backend until it falls sick.
- VMOD shared libraries are now copied to the workdir, to avoid problems when VMODs are updated via packaging systems.
- Bump the VRT version to 6.0.
- Export more symbols from libvarnishapi.so.
- The size of the VSL log is limited to 4G-1b, placing upper bounds on the -l option and the vsl_space and vsm_space parameters.
- Added parameters clock_step, thread_pool_reserve and ban_cutoff.
- Parameters vcl_dir and vmod_dir are deprecated, use vcl_path and vmod_path instead.
- All parameters are defined, even on platforms that don't support them. An unsupported parameter is documented as such in param.show. Setting such a parameter is not an error, but has no effect.
- Clarified the interpretations of the + and - operators in VCL with operands of the various data types.
- DURATION types may be used in boolean contexts.
- INT, DURATION and REAL values can now be negative.
- Response codes 1000 or greater may now be set in VCL internally. resp.status is delivered modulo 1000 in client responses.
- IP addresses can be compared for equality in VCL.
- Introduce the STEVEDORE data type, and the objects storage.SNAME in VCL. Added req.storage and beresp.storage; beresp.storage_hint is deprecated.
- Retired the umem stevedore.
- req.ttl is deprecated.
- Added std.getenv() and std.late_100_continue().
- The fetch_failed stat is incremented for any kind of fetch failure.
- Added the stats n_test_gunzip and bans_lurker_obj_killed_cutoff.
- Clarified the meanings of the %r, %{X}i and %{X}o formatters in varnishncsa.
- 2251 - varnishapi.pc and varnishconfdir
- 2250 - vrt.h now depends on vdef.h making current vmod fail.
- 2249 - "logexpect -wait" doesn't fail
- 2245 - Varnish doesn't start, if use vmod (vmod_cache dir was permission denied)
- 2241 - VSL fails to get hold of SHM
- 2233 - Crash on "Assert error in WS_Assert(), cache/cache_ws.c line 59"
- 2227 - -C flag broken in HEAD
- 2217 - fix argument processing -C regression
- 2207 - Assert error in V1L_Write()
- 2205 - Strange bug when I set client.ip with another string
- 2203 - unhandled SIGPIPE
- 2200 - Assert error in vev_compact_pfd(), vev.c line 394
- 2197 - ESI parser panic on malformed src URL
- 2190 - varnishncsa: The %r formatter is NOT equivalent to "%m http://%{Host}i%U%q %H"
- 2186 - Assert error in sml_iterator(), storage/storage_simple.c line 263
- 2184 - Cannot subtract a negative number
- 2177 - Clarify interactions between restarts and labels
- 2175 - Backend leak between a top VCL and a label
- 2174 - Cflags overhaul
- 2167 - VCC will not parse a literal negative number where INT is expected
- 2155 - vmodtool removes text following $Event from RST docs
- 2151 - Health probes do not honor a backend's PROXY protocol setting
- 2142 - ip comparison fails
- 2148 - varnishncsa cannot decode Authorization header if the format is incorrect.
- 2143 - Assert error in exp_inbox(), cache/cache_expire.c line 195
- 2134 - Disable Nagle's
- 2129 - stack overflow with >4 level esi
- 2128 - SIGSEGV NULL Pointer in STV__iter()
- 2118 - "varnishstat -f MAIN.sess_conn -1" produces empty output
- 2117 - SES_Close() EBADF / Wait_Enter() wp->fd <= 0
- 2115 - VSM temporary files are not always deleted
- 2110 - [CLI] vcl.inline failures
- 2104 - Assert error in VFP_Open(), cache/cache_fetch_proc.c line 139: Condition((vc->wrk->vsl) != 0) not true
- 2099 - VCC BACKEND/HDR comparison produces duplicate gethdr_s definition
- 2096 - H2 t2002 fail on arm64/arm32
- 2094 - H2 t2000 fail on arm64/arm32
- 2078 - VCL comparison doesn't fold STRING_LIST
- 2052 - d12.vtc flaky when compiling with suncc
- 2042 - Send a 304 response for a just-gone-stale hitpass object when appropriate
- 2041 - Parent process should exit if it fails to start child
- 2035 - varnishd stalls with two consecutive Range requests using HTTP persistent connections
- 2026 - Add restart of poll in read_tmo
- 2021 - vcc "used before defined" check
- 2017 - "%r" field is wrong
- 2016 - confusing vcc error when acl referenced before definition
- 2014 - req.ttl: retire or document+vtc
- 2010 - varnishadm CLI behaving weirdly
- 1991 - Starting varnish on Linux with boot param ipv6.disable=1 fails
- 1988 - Lost req.url gives misleading error
- 1914 - set a custom storage for cache_req_body
- 1899 - varnishadm vcl.inline is overly obscure
- 1874 - clock-step related crash
- 1865 - Panic accessing beresp.backend.ip in vcl_backend_error{}
- 1856 - LostHeader setting req.url to an empty string
- 1834 - WS_Assert(), cache/cache_ws.c line 59
- 1830 - VSL API: "duplicate link" errors in request grouping when vsl_buffer is increased
- 1764 - nuke_limit is not honored
- 1750 - Fail more gracefully on -l >= 4GB
- 1704 - fetch_failed not incremented
- Documentation updates, especially the what's new and upgrade sections.
- Via: header made by Varnish now says 5.0.
- VMOD VRT ABI level increased.
- [vcl] obj.(ttl|age|grace|keep) is now readable in vcl_deliver.
- Latest devicedetect.vcl imported from upstream.
- New system wide VCL directory:
/usr/share/varnish/vcl/
- std.integer() can now convert from REAL.
- 2086 - Ignore H2 upgrades if the feature is not enabled.
- 2054 - Introduce new macros for out-of-tree VMODs
- 2022 - varnishstat -1 -f field inclusion glob doesn't allow VBE backend fields
- 2008 - Panic: Assert error in VBE_Delete()
- 1800 - PRIV_TASK in vcl_init/fini
This is the first beta release of the upcoming 5.0 release.
The list of changes are numerous and will not be expanded on in detail.
The release notes contain more background information and are highly recommended reading before using any of the new features.
Major items:
- VCL labels, allowing for per-vhost (or per-anything) separate VCL files.
- (Very!) experimental support for HTTP/2.
- Always send the request body to the backend, making possible to cache responses of POST, PATCH requests etc with appropriate custom VCL and/or VMODs.
- hit-for-pass is now actually hit-for-miss.
- new shard director for loadbalancing by consistent hashing
- ban lurker performance improvements
- access to obj.ttl, obj.age, obj.grace and obj.keep in vcl_deliver
- workspace and PRIV_TASK for vcl cli events (init/fini methods)
- PRIV_* now also work for object methods with unchanged scope.
Changes since 4.1.8:
- Added
bereq.is_bgfetch
which is true for background fetches. - Add the vtc feature ignore_unknown_macro.
- Expose to VCL whether or not a fetch is a background fetch (bgfetch)
- Ignore req.ttl when keeping track of expired objects (see 2422)
- Move a cli buffer to VSB (from stack).
- Use a separate stack for signals.
- 2337 and 2366 - Both Upgrade and Connection headers are needed for WebSocket now
- 2372 - Fix problem with purging and the n_obj_purged counter
- 2373 - VSC n_vcl, n_vcl_avail, n_vcl_discard are gauge
- 2380 - Correct regexp in examples.
- 2390 - Straighten locking wrt vcl_active
- 2429 - Avoid buffer read overflow on vcl_backend_error and -sfile
- 2492 - Use the idle read timeout only on empty requests
Changes since 4.1.7:
- Update in the documentation of timestamps
- 2379 - Correctly handle bogusly large chunk sizes (VSV00001)
Changes since 4.1.7-beta1:
- Add extra locking to protect the pools list and refcounts
- Don't panic on a null ban
- 2321 - Prevent storage backends name collisions
Changes since 4.1.6:
- Add -vsl_catchup to varnishtest
- Add record-prefix support to varnishncsa
- 1764 - Correctly honor nuke_limit parameter
- 2022 - varnishstat -1 -f field inclusion glob doesn't allow VBE backend fields
- 2069 - Health probes fail when HTTP response does not contain reason phrase
- 2118 - "varnishstat -f MAIN.sess_conn -1" produces empty output
- 2219 - Remember to reset workspace
- 2320 - Rework and fix varnishstat counter filtering
- 2329 - Docfix: Only root can jail
- Introduce a vxid left hand side for VSL queries. This allows matching on records matching a known vxid.
- Environment variables are now available in the stdandard VMOD; std.getenv()
- Add setenv command to varnishtest
- 2200 - Dramatically simplify VEV, fix assert in vev.c
- 2216 - Make sure Age is always less than max-age
- 2233 - Correct check when parsing the query string
- 2241 - VSL fails to get hold of SHM
- 2270 - Newly loaded auto VCLs don't get their go_cold timer set
- 2273 - Master cooling problem
- 2275 - If the client workspace is almost, but not quite exhausted, we may not be able to get enough iovec's to do Chunked transmission.
- 2295 - Spinning loop in VBE_Poll causes master to kill child on CLI timeout
- 2301 - Don't attempt to check if varnishd is still running if we have already failed.
- 2313 - Cannot link to varnishapi, symbols missing
- No code changes since 4.1.5-beta2.
- Update devicedetect.vcl
- 1704 - Reverted the docfix and made the fetch_failed counter do what the documentation says it should do
- 1865 - Panic accessing beresp.backend.ip in vcl_backend_error
- 2167 - VCC will not parse a literal negative number where INT is expected
- 2184 - Cannot subtract a negative number
- 1704 - (docfix) Clarify description of fetch_failed counter
- 1834 - Panic in workspace exhaustion conditions
- 2106 - 4.1.3: Varnish crashes with "Assert error in CNT_Request(), cache/cache_req_fsm.c line 820"
- 2134 - Disable Nagle's
- 2148 - varnishncsa cannot decode Authorization header if the format is incorrect.
- 2168 - Compare 'bereq.backend' / 'req.backend_hint' myDirector.backend() does not work
- 2178 - 4.1 branch does not compile on FreeBSD
- 2188 - Fix vsm_free (never incremented)
- 2190 - (docfix)varnishncsa: The %r formatter is NOT equivalent to...
- 2197 - ESI parser panic on malformed src URL
- 2035 - varnishd stalls with two consecutive Range requests using HTTP persistent connections
- Include the current time of the panic in the panic output
- Keep a reserve of idle threads for vital tasks
- 1874 - clock-step related crash
- 1889 - (docfix) What does -p flag for backend.list command means
- 2115 - VSM temporary files are not always deleted
- 2129 - (docfix) stack overflow with >4 level esi
- 1830 - VSL API: "duplicate link" errors in request grouping when vsl_buffer is increased
- 2010 - varnishadm CLI behaving weirdly
- 2017 - varnishncsa docfix: "%r" field is wrong
- 2107 - (docfix) HEAD requests changed to GET
- [varnishhist] Various improvements
- [varnishtest] A cmd feature for custom shell-based checks
- Documentation improvements (do_stream, sess_herd, timeout_linger, thread_pools)
- [varnishtop] Documented behavior when both -p and -1 are specified
- 2027 - Racy backend selection
- 2024 - panic vmod_rr_resolve() round_robin.c line 75 (be) != NULL
- 2011 - VBE.*.conn (concurrent connections to backend) not working as expected
- 2008 - Assert error in VBE_Delete()
- 2007 - Update documentation part about CLI/management port authentication parameter
- 1881 - std.cache_req_body() w/ return(pipe) is broken
- Be stricter when parsing request headers to harden against smuggling attacks.
- New parameter vsm_free_cooldown. Specifies how long freed VSM memory (shared log) will be kept around before actually being freed.
- varnishncsa now accepts -L argument to configure the limit on incomplete transactions kept. (Issue 1994)
- 1984 - Make the counter vsm_cooling act according to spec
- 1963 - Avoid abort when changing to a VCL name which is a path
- 1933 - Don't trust dlopen refcounting
- varnishncsa can now access and log backend requests. (PR #1905)
- [varnishncsa] New output formatters %{Varnish:vxid}x and %{VSL:Tag}x.
- [varnishlog] Added log tag BackendStart on backend transactions.
- On SmartOS, use ports instead of epoll by default.
- Add support for TCP Fast Open where available. Disabled by default.
- [varnishtest] New synchronization primitive barriers added, improving coordination when test cases call external programs.
- 1971 - Add missing Wait_HeapDelete
- 1967 - [ncsa] Remove implicit line feed when using formatfile
- 1955 - 4.1.x sometimes duplicates Age and Accept-Ranges headers
- 1954 - Correctly handle HTTP/1.1 EOF response
- 1953 - Deal with fetch failures in ved_stripgzip
- 1931 - Allow VCL set Last-Modified to be used for I-M-S processing
- 1928 - req->task members must be set in case we get onto the waitinglist
- 1924 - Make std.log() and std.syslog() work from vcl_{init,fini}
- 1919 - Avoid ban lurker panic with empty olist
- 1918 - Correctly handle EOF responses with HTTP/1.1
- 1912 - Fix (insignificant) memory leak with mal-formed ESI directives.
- 1904 - Release memory instead of crashing on malformed ESI
- 1885 - [vmodtool] Method names should start with a period
- 1879 - Correct handling of duplicate headers on IMS header merge
- 1878 - Fix a ESI+gzip corner case which had escaped notice until now
- 1873 - Check for overrun before looking at the next vsm record
- 1871 - Missing error handling code in V1F_Setup_Fetch
- 1869 - Remove temporary directory iff called with -C
- 1883 - Only accept C identifiers as acls
- 1855 - Truncate output if it's wider than 12 chars
- 1806 - One minute delay on return (pipe) and a POST-Request
- 1725 - Revive the backend_conn counter
- [vmods] vmodtool improvements for multiple VMODs in a single directory.
- 1860 - ESI-related memory leaks
- 1863 - Don't reset the oc->ban pointer from BAN_CheckObject
- 1864 - Avoid panic if the lurker is working on a ban to be checked.
- [vmods] Passing VCL ACL to a VMOD is now possible.
- [vmods] VRT_MINOR_VERSION increase due to new function: VRT_acl_match()
- Some test case stabilization fixes and minor documentation updates.
- Improved handling of workspace exhaustion when fetching objects.
- 1858 - Hit-for-pass objects are not IMS candidates
- Be stricter when parsing a HTTP request to avoid potential HTTP smuggling attacks against vulnerable backends.
- Some fixes to minor/trivial issues found with clang AddressSanitizer.
- Arithmetic on REAL data type in VCL is now possible.
- vmodtool.py improvements to allow VMODs for 4.0 and 4.1 to share a source tree.
- Off-by-one in WS_Reset() fixed.
- "https_scheme" parameter added. Enables graceful handling of compound request URLs with HTTPS scheme. (Bug 1847)
- 1739 - Workspace overflow handling in VFP_Push()
- 1837 - Error compiling VCL if probe is referenced before it is defined
- 1841 - Replace alien FD's with /dev/null rather than just closing them
- 1843 - Fail HTTP/1.0 POST and PUT requests without Content-Length
- 1844 - Correct ENUM handling in object constructors
- 1851 - Varnish 4.1.1 fails to build on i386
- 1852 - Add a missing VDP flush operation after ESI:includes.
- 1857 - Fix timeout calculation for session herding.
- No code changes since 4.1.1-beta2.
- Improvements to VCL temperature handling added. This opens for reliably deny warming a cooling VCL from a VMOD.
- 1802 - Segfault after VCL change
- 1825 - Cannot Start Varnish After Just Restarting The Service
- 1842 - Handle missing waiting list gracefully.
- 1845 - Handle whitespace after floats in test fields
- Format of "ban.list" has changed slightly.
- [varnishncsa] -w is now required when running daemonized.
- [varnishncsa] Log format can now be read from file.
- Port fields extracted from PROXY1 header now work as expected.
- New VCL state "busy" introduced (mostly for VMOD writers).
- Last traces of varnishreplay removed.
- If-Modified-Since is now ignored if we have If-None-Match.
- Zero Content-Length is no longer sent on 304 responses.
- vcl_dir and vmod_dir now accept a colon separated list of directories.
- Nested includes starting with "./" are relative to the including VCL file now.
- 1796 - Don't attempt to allocate a V1L from the workspace if it is overflowed.
- 1794 - Fail if multiple -a arguments return the same suckaddr.
- 1763 - Restart epoll_wait on EINTR error
- 1788 - ObjIter has terrible performance profile when busyobj != NULL
- 1798 - Varnish requests painfully slow with large files
- 1816 - Use a weak comparison function for If-None-Match
- 1818 - Allow grace-hits on hit-for-pass objects, [..]
- 1821 - Always slim private & pass objects after delivery.
- 1823 - Rush the objheader if there is a waiting list when it is deref'ed.
- 1826 - Ignore 0 Content-Lengths in 204 responses
- 1813 - Fail if multiple -a arguments return the same suckaddr.
- 1810 - Improve handling of HTTP/1.0 clients
- 1807 - Return 500 if we cannot decode the stored object into the resp.*
- 1804 - Log proxy related messages on the session, not on the request.
- 1801 - Relax IP constant parsing
- Documentation updates.
- Stabilization fixes on testcase p00005.vtc.
- Avoid compiler warning in zlib.
- Bug 1792: Avoid using fallocate() with -sfile on non-EXT4.
- Redhat packaging files are now separate from the normal tree.
- Client workspace overflow should now result in a 500 response instead of panic.
- [varnishstat] -w option has been retired.
- libvarnishapi release number is increased.
- Body bytes sent on ESI subrequests with gzip are now counted correctly.
- [vmod-std] Data type conversion functions now take additional fallback argument.
- 1777 - Disable speculative Range handling on streaming transactions.
- 1778 - [varnishstat] Cast to integer to prevent negative values messing the statistics
- 1781 - Propagate gzip CRC upwards from nested ESI includes.
- 1783 - Align code with RFC7230 section 3.3.3 which allows POST without a body.
Changes between 4.0 and 4.1 are numerous. Please read the upgrade section in the documentation for a general overview.
- No changes.
- Superseded objects are now expired immediately.
- 1462 - Use first/last log entry in varnishncsa.
- 1539 - Avoid panic when expiry thread modifies a candidate object.
- 1637 - Fail the fetch processing if the vep callback failed.
- 1665 - Be more accurate when computing client RX_TIMEOUT.
- 1672 - Do not panic on unsolicited 304 response to non-200 bereq.
- Assorted documentation updates.
- 1479 - Fix out-of-tree builds.
- 1566 - Escape VCL string question marks.
- 1616 - Correct header file placement.
- 1620 - Fail miss properly if out of backend threads. (Also 1621)
- 1628 - Avoid dereferencing null in VBO_DerefBusyObj().
- 1629 - Ditch rest of waiting list on failure to reschedule.
- 1660 - Don't attempt range delivery on a synth response
- Support older autoconf (< 2.63b) (el5)
- A lot of minor documentation fixes.
- bereq.uncacheable is now read-only.
- obj.uncacheable is now readable in vcl_deliver.
- [varnishadm] Prefer exact matches for backend.set_healthy. Bug 1349.
- Hard-coded -sfile default size is removed.
- [packaging] EL6 packages are once again built with -O2.
- [parameter] fetch_chunksize default is reduced to 16KB. (from 128KB)
- Added std.time() which converts strings to VCL_TIME.
- [packaging] packages now Provide strictABI (gitref) and ABI (VRT major/minor) for VMOD use.
- 1378 - Properly escape non-printable characters in varnishncsa.
- 1596 - Delay HSH_Complete() until the storage sanity functions has finished.
- 1506 - Keep Content-Length from backend if we can.
- 1602 - Fix a cornercase related to empty pass objects.
- 1607 - Don't leak reqs on failure to revive from waitinglist.
- 1610 - Update forgotten varnishlog example to 4.0 syntax.
- 1612 - Fix a cornercase related to empty pass objects.
- 1623 - Fix varnishhist -d segfault.
- 1636 - Outdated paragraph in Vary: documentation
- 1638 - Fix panic when retrying a failed backend fetch.
- 1639 - Restore the default SIGSEGV handler during pan_ic
- 1647 - Relax an assertion for the IMS update candidate object.
- 1648 - Avoid partial IMS updates to replace old object.
- 1650 - Collapse multiple X-Forwarded-For headers
New since 4.0.2-rc1:
- [varnishlog] -k argument is back. (exit after n records)
- [varnishadm] vcl.show is now listed in help.
New since 4.0.1:
- [libvmod-std] New function strstr() for matching substrings.
- server.(hostname|identity) is now available in all VCL functions.
- VCL variable type BYTES was added.
- workspace_client default is now 9k.
- [varnishstat] Update interval can now be subsecond.
- Document that reloading VCL does not reload a VMOD.
- Guru meditation page is now valid HTML5.
- [varnishstat] hitrate calculation is back.
- New parameter group_cc adds a GID to the grouplist of VCL compiler sandbox.
- Parameter shm_reclen is now an alias for vsl_reclen.
- Workspace overflows are now handled with a 500 client response.
- VCL variable type added: HTTP, representing a HTTP header set.
- It is now possible to return(synth) from vcl_deliver.
- [varnishadm] vcl.show now has a -v option that output the complete set of VCL and included VCL files.
- RHEL7 packaging (systemd) was added.
- [libvmod-std] querysort() fixed parameter limit has been lifted.
- Fix small memory leak in ESI parser.
- Fix unreported race/assert in V1D_Deliver().
- 1553 - Fully reset workspace (incl. Vary state) before reusing it.
- 1551 - Handle workspace exhaustion during purge.
- 1591 - Group entries correctly in varnishtop.
- 1592 - Bail out on workspace exhaustion in VRT_IP_string.
- 1538 - Relax VMOD ABI check for release branches.
- 1584 - Don't log garbage/non-HTTP requests. [varnishncsa]
- 1407 - Don't rename VSM file until child has started.
- 1466 - Don't leak request structs on restart after waitinglist.
- 1580 - Output warning if started without -b and -f. [varnishd]
- 1583 - Abort on fatal sandbox errors on Solaris. (Related: 1572)
- 1585 - Handle fatal sandbox errors.
- 1572 - Exit codes have been cleaned up.
- 1569 - Order of symbols should not influence compilation result.
- 1579 - Clean up type inference in VCL.
- 1578 - Don't count Age twice when computing new object TTL.
- 1574 - std.syslog() logged empty strings.
- 1555 - autoconf editline/readline build issue.
- 1568 - Skip NULL arguments when hashing.
- 1567 - Compile on systems without SO_SNDTIMEO/SO_RCVTIMEO.
- 1512 - Changes to bereq are lost between v_b_r and v_b_f.
- 1563 - Increase varnishtest read timeout.
- 1561 - Never call a VDP with zero length unless done.
- 1562 - Fail correctly when rereading a failed client request body.
- 1521 - VCL compilation fails on OSX x86_64.
- 1547 - Panic when increasing shm_reclen.
- 1503 - Document return(retry).
- 1581 - Don't log duplicate Begin records to shmlog.
- 1588 - Correct timestamps on pipelined requests.
- 1575 - Use all director backends when looking for a healthy one.
- 1577 - Read the full request body if shunted to synth.
- 1532 - Use correct VCL representation of reals.
- 1531 - Work around libedit bug in varnishadm.
New since 4.0.0:
- New functions in vmod_std: real2time, time2integer, time2real, real.
- Chunked requests are now supported. (pass)
- Add std.querysort() that sorts GET query arguments. (from libvmod-boltsort)
- Varnish will no longer reply with "200 Not Modified".
- Backend IMS is now only attempted when last status was 200.
- Packaging now uses find-provides instead of find-requires. [redhat]
- Two new counters: n_purges and n_obj_purged.
- Core size can now be set from /etc/sysconfig/varnish [redhat]
- Via header set is now RFC compliant.
- Removed "purge" keyword in VCL. Use return(purge) instead.
- fallback director is now documented.
- %D format flag in varnishncsa is now truncated to an integer value.
- persistent storage backend is now deprecated. https://www.varnish-cache.org/docs/trunk/phk/persistent.html
- Added format flags %I (total bytes received) and %O (total bytes sent) for varnishncsa.
- python-docutils >= 0.6 is now required.
- Support year (y) as a duration in VCL.
- VMOD ABI requirements are relaxed, a VMOD no longer have to be run on the same git revision as it was compiled for. Replaced by a major/minor ABI counter.
- 1269 - Use correct byte counters in varnishncsa when piping a request.
- 1524 - Chunked requests should be pipe-able.
- 1530 - Expire old object on successful IMS fetch.
- 1475 - time-to-first-byte in varnishncsa was potentially dishonest.
- 1480 - Porting guide for 4.0 is incomplete.
- 1482 - Inherit group memberships of -u specified user.
- 1473 - Fail correctly in configure when rst2man is not found.
- 1486 - Truncate negative Age values to zero.
- 1488 - Don't panic on high request rates.
- 1489 - req.esi should only be available in client threads.
- 1490 - Fix thread leak when reducing number of threads.
- 1491 - Reorder backend connection close procedure to help test cases.
- 1498 - Prefix translated VCL names to avoid name clashes.
- 1499 - Don't leak an objcore when HSH_Lookup returns expired object.
- 1493 - vcl_purge can return synth or restart.
- 1476 - Cope with systems having sys/endian.h and endian.h.
- 1496 - varnishadm should be consistent in argv ordering.
- 1494 - Don't panic on VCL-initiated retry after a backend 500 error.
- 1139 - Also reset keep (for IMS) time when purging.
- 1478 - Avoid panic when delivering an object that expires during delivery.
- 1504 - ACLs can be unreferenced with vcc_err_unref=off set.
- 1501 - Handle that a director couldn't pick a backend.
- 1495 - Reduce WRK_SumStat contention.
- 1510 - Complain on symbol reuse in VCL.
- 1514 - Document storage.NAME.free_space and .used_space [docs]
- 1518 - Suppress body on 304 response when using ESI.
- 1519 - Round-robin director does not support weight. [docs]
New since 4.0.0-beta1:
- improved varnishstat documentation.
- In VCL, req.backend_hint is available in vcl_hit
- ncurses is now a dependency.
- 1469 - Fix build error on PPC
- 1468 - Set ttl=0 on failed objects
- 1462 - Handle duplicate ReqURL in varnishncsa.
- 1467 - Fix missing clearing of oc->busyobj on HSH_Fail.
New since TP2:
- Previous always-appended code called default.vcl is now called builtin.vcl. The new example.vcl is recommended as a starting point for new users.
- vcl_error is now called vcl_synth, and does not any more mandate closing the client connection.
- New VCL function vcl_backend_error, where you can change the 503 prepared if all your backends are failing. This can then be cached as a regular object.
- Keyword "remove" in VCL is replaced by "unset".
- new timestamp and accounting records in varnishlog.
- std.timestamp() is introduced.
- stored objects are now read only, meaning obj.hits now counts per objecthead instead. obj.lastuse saw little use and has been removed.
- builtin VCL now does return(pipe) for chunked POST and PUT requests.
- python-docutils and rst2man are now build requirements.
- cli_timeout is now 60 seconds to avoid slaughtering the child process in times of high IO load/scheduling latency.
- return(purge) from vcl_recv is now valid.
- return(hash) is now the default return action from vcl_recv.
- req.backend is now req.backend_hint. beresp.storage is beresp.storage_hint.
- 1460 - tools now use the new timestamp format.
- 1450 - varnishstat -l segmentation fault.
- 1320 - Work around Content-Length: 0 and Content-Encoding: gzip gracefully.
- 1458 - Panic on busy object.
- 1417 - Handle return(abandon) in vcl_backend_response.
- 1455 - vcl_pipe now sets Connection: close by default on backend requests.
- 1454 - X-Forwarded-For is now done in C, before vcl_recv is run.
- 1436 - Better explanation when missing an import in VCL.
- 1440 - Serve ESI-includes from a different backend.
- 1441 - Incorrect grouping when logging ESI subrequests.
- 1434 - std.duration can now do ms/milliseconds.
- 1419 - Don't put objcores on the ban list until they go non-BUSY.
- 1405 - Ban lurker does not always evict all objects.
- New VCL_BLOB type to pass binary data between VMODs.
- New format for VMOD description files. (.vcc)
- 1404 - Don't send Content-Length on 304 Not Modified responses.
- 1401 - Varnish would crash when retrying a backend fetch too many times.
- 1399 - Memory get freed while in use by another thread/object
- 1398 - Fix NULL deref related to a backend we don't know anymore.
- 1397 - Crash on backend fetch while LRUing.
- 1395 - End up in vcl_error also if fetch fails vcl_backend_response.
- 1391 - Client abort and retry during a streaming fetch would make Varnish assert.
- 1390 - Fix assert if the ban lurker is overtaken by new duplicate bans.
- 1385 - ban lurker doesn't remove (G)one bans
- 1383 - varnishncsa logs requests for localhost regardless of host header.
- 1382 - varnishncsa prints nulls as part of request string.
- 1381 - Ensure vmod_director is installed
- 1323 - Add a missing boundary check for Range requests
- 1268 - shortlived parameter now uses TTL+grace+keep instead of just TTL.
- Fix build error on OpenBSD (TCP_KEEP)
- n_object wasn't being decremented correctly on object expire.
- Example default.vcl in distribution is now 4.0-ready.
- 1405 - Ban lurker does not always evict all objects.
- No changes.
- Requests with multiple Content-Length headers will now fail.
- Stop recognizing a single CR (r) as a HTTP line separator. This opened up a possible cache poisoning attack in stacked installations where sslterminator/varnish/backend had different CR handling.
- Improved error detection on master-child process communication, leading to faster recovery (child restart) if communication loses sync.
- Fix a corner-case where Content-Length was wrong for HTTP 1.0 clients, when using gzip and streaming. Bug 1627.
- More robust handling of hop-by-hop headers.
- [packaging] Coherent Redhat pidfile in init script. Bug 1690.
- Avoid memory leak when adding bans.
- Minor changes to documentation.
- [varnishadm] Add termcap workaround for libedit. Bug 1531.
- Document storage.<name>.* VCL variables. Bug 1514.
- Fix memory alignment panic when http_max_hdr is not a multiple of 4. Bug 1327.
- Avoid negative ReqEnd timestamps with ESI. Bug 1297.
- %D format for varnishncsa is now an integer (as documented)
- Fix compile errors with clang.
- Clear objectcore flags earlier in ban lurker to avoid spinning thread. Bug 1470.
- Patch embedded jemalloc to avoid segfault. Bug 1448.
- Allow backend names to start with if, include or else. Bug 1439.
- Stop handling gzip after gzip body end. Bug 1086.
- Document %D and %T for varnishncsa.
- Always check the local address of a socket. This avoids a crash if server.ip is accessed after a client has closed the connection. Bug #1376
- Stop printing error messages on ESI parse errors
- Fix a problem where Varnish would segfault if the first part of a synthetic page was NULL. Bug #1287
- If streaming was used, you could in some cases end up with duplicate content headers being sent to clients. Bug #1272
- If we receive a completely garbled request, don't pass through vcl_error, since we could then end up in vcl_recv through a restart and things would go downhill from there. Bug #1367
- Prettify backtraces on panic slightly.
- Correct an error where -m, -c and -b would interact badly, leading to lack of matches. Also, emit BackendXID to signify the start of a transaction. Bug #1325
- Handle input from stdin properly. Bug #1314
- Set the waiter pipe as non-blocking and record overflows. Bug #1285
- Fix up a bug in the ACL compile code that could lead to false negatives. CVE-2013-4090. Bug #1312
- Return an error if the client sends multiple Host headers.
- Fix error handling when uncompressing fetched objects for ESI processing. Bug #1184
- Be clearer about which timeout was reached in logs.
- Correctly decrement n_waitinglist counter. Bug #1261
- Turn off Nagle/set TCP_NODELAY.
- Avoid panic on malformed Vary headers. Bug #1275
- Increase the maximum length of backend names. Bug #1224
- Add support for banning on http.status. Bug #1076
- Make hit-for-pass correctly prefer the transient storage.
- If -m, but neither -b or -c is given, assume both. This filters out a lot of noise when -m is used to filter. Bug #1071
- Improve tab completion and require libedit/readline to build.
- Reopen log file if Varnish is restarted.
- Handle file descriptors above 64k (by ignoring them). Prevents a crash in some cases with corrupted shared memory logs.
- Add %D and %T support for more timing information.
- Documentation updates.
- Fixes for OSX
- Disable PCRE JIT-er, since it's broken in some PCRE versions, at least on i386.
- Make libvarnish prefer exact hits when looking for VSL tags.
- Fix a race on the n_sess counter. This race made varnish do excessive session workspace allocations. Bug #897.
- Fix some crashes in the gzip code when it runs out of memory. Bug #1037. Bug #1043. Bug #1044.
- Fix a bug where the regular expression parser could end up in an infinite loop. Bug #1047.
- Fix a memory leak in the regex code.
- DNS director now uses port 80 by default if not specified.
- Introduce idle_send_timeout and increase default value for send_timeout to 600s. This allows a long send timeout for slow clients while still being able to disconnect idle clients.
- Fix an issue where <esi:remove> did not remove HTML comments. Bug #1092.
- Fix a crash when passing with streaming on.
- Fix a crash in the idle session timeout code.
- Fix an issue where the poll waiter did not timeout clients if all clients were idle. Bug #1023.
- Log regex errors instead of crashing.
- Introduce pcre_match_limit, and pcre_match_limit_recursion parameters.
- Add CLI commands to manually control health state of a backend.
- Fix an issue where the s_bodybytes counter is not updated correctly on gunzipped delivery.
- Fix a crash when we couldn't allocate memory for a fetched object. Bug #1100.
- Fix an issue where objects could end up in the transient store with a long TTL, when memory could not be allocated for them in the requested store. Bug #1140.
- Activate req.hash_ignore_busy when req.hash_always_miss is activated. Bug #1073.
- Reject invalid tcp port numbers for listen address. Bug #1035.
- Enable JIT for better performing regular expressions. Bug #1080.
- Return VCL errors in exit code when using -C. Bug #1069.
- Stricter validation of acl syntax, to avoid a crash with 5-octet IPv4 addresses. Bug #1126.
- Fix a crash when first argument to regsub was null. Bug #1125.
- Fix a case where varnish delivered corrupt gzip content when using ESI. Bug #1109.
- Fix a case where varnish didn't remove the old Date header and served it alongside the varnish-generated Date header. Bug #1104.
- Make saint mode work, for the case where we have no object with that hash. Bug #1091.
- Don't save the object body on hit-for-pass objects.
- n_ban_gone counter added to count the number of "gone" bans.
- Ban lurker rewritten to properly sleep when no bans are present, and otherwise to process the list at the configured speed.
- Fix a case where varnish delivered wrong content for an uncompressed page with compressed ESI child. Bug #1029.
- Fix an issue where varnish runs out of thread workspace when processing many ESI includes on an object. Bug #1038.
- Fix a crash when streaming was enabled for an empty body.
- Better error reporting for some fetch errors.
- Small performance optimizations.
- Support for tn in varnishncsa format strings.
- Add new format: %{VCL_Log:foo}x which output key:value from std.log() in VCL.
- Add user-defined date formatting, using %{format}t.
- resp.body is now available for inspection.
- Make it possible to test for the absence of an HTTP header. Bug #1062.
- Log the full panic message instead of shortening it to 512 characters.
- Add json output (-j).
- Documentation updates.
- Bump minimum number of threads to 50 in RPM packages.
- RPM packaging updates.
- Fix some compilation warnings on Solaris.
- Fix some build issues on Open/Net/DragonFly-BSD.
- Fix build on FreeBSD 10-current.
- Fix libedit detection on *BSD OSes. Bug #1003.
- Make the size of the synthetic object workspace equal to http_resp_size and add workaround to avoid a crash when setting too long response strings for synthetic objects.
- Ensure the ban lurker always sleeps the advertised 1 second when it does not have anything to do.
- Remove error from vcl_deliver. Previously this would assert while it will now give a syntax error.
- Add default values for some fields when logging incomplete records and document the default values.
- Documentation updates
- Some Solaris portability updates.
- Only log the first 20 bytes of extra headers to prevent overflows.
- Fix crasher bug which sometimes happened if responses are queued and the backend sends us Vary. Bug #994.
- Log correct size of compressed when uncompressing them for clients that do not support compression. Bug #996.
- Only send Range responses if we are going to send a body. Bug #1007.
- When varnishd creates a storage file, also unlink it to avoid leaking disk space over time. Bug #1008.
- The default size of the -s file parameter has been changed to 100MB instead of 50% of the available disk space.
- The limit on the number of objects we remove from the cache to make room for a new one was mistakenly lowered to 10 in 3.0.1. This has been raised back to 50. Bug #1012.
- http_req_size and http_resp_size have been increased to 8192 bytes. This better matches what other HTTPds have. Bug #1016.
- Allow relational comparisons of floating point types.
- Make it possible for VMODs to fail loading and so cause the VCL loading to fail.
- Fixed crash when client was sending illegal HTTP headers.
- %{Varnish:handling} in format strings was broken, this has been fixed.
- Documentation updates
- Some Solaris portability updates.
- Fix crash in streaming code.
- Add fallback director, as a variant of the round-robin director.
- The parameter http_req_size has been reduced on 32 bit machines.
- Disallow error in the vcl_init and vcl_fini VCL functions.
- Fixed crash when using -X.
- Fix error when the time to first byte was in the format string.
- Documentation updates
- Avoid sending an empty end-chunk when sending bodyless responses.
- http_resp_hdr_len and http_req_hdr_len were set to too low values leading to clients receiving HTTP 400 Bad Request errors. The limit has been increased and the error code is now HTTP 413 Request entity too large.
- Objects with grace or keep set were mistakenly considered as candidates for the transient storage. They now have their grace and keep limited to limit the memory usage of the transient stevedore.
- If a request was restarted from vcl_miss or vcl_pass it would crash. This has been fixed. Bug #965.
- Only the first few clients waiting for an object from the backend would be woken up when object arrived and this lead to some clients getting stuck for a long time. This has now been fixed. Bug #963.
- The hash and client directors would mistakenly retry fetching an object from the same backend unless health probes were enabled. This has been fixed and it will now retry a different backend.
- Request specific variables such as client.* and server.* are now correctly marked as not available in vcl_init and vcl_fini.
- The VCL compiler would fault if two IP comparisons were done on the same line. This now works correctly. Bug #948.
- Add support for logging arbitrary request and response headers.
- Fix crashes if hitmiss and handling have not yet been set.
- Avoid printing partial log lines if there is an error in a format string.
- Report user specified format string errors better.
- varnishlog -r now works correctly again and no longer opens the shared log file of the running Varnish.
- Various documentation updates.
- Minor compilation fixes for newer compilers.
- A bug in the ESI entity replacement parser has been fixed. Bug #961.
- The ABI of VMODs are now checked. This will require a rebuild of all VMODs against the new version of Varnish.
- Avoid sending an empty end-chunk when sending bodyless responses.
- The synthetic keyword has now been properly marked as only available in vcl_deliver. Bug #936.
- Fix crash if the secret file was unreadable. Bug #935.
- Always exit if varnishadm can't connect to the backend for any reason.
- thread_pool_min and thread_pool_max now each refer to the number of threads per pool, rather than being inconsistent as they were before.
- 307 Temporary redirect is now considered cacheable. Bug #908.
- The stats command has been removed from the CLI interface. With the new counters, it would mean implementing more and more of varnishstat in the master CLI process and the CLI is single-threaded so we do not want to do this work there in the first place. Use varnishstat instead.
- VCL now treats null arguments (unset headers for instance) as empty strings. Bug #913.
- VCL now has vcl_init and vcl_fini functions that are called when a given VCL has been loaded and unloaded.
- There is no longer any interpolation of the right hand side in bans where the ban is a single string. This was confusing and you now have to make sure bits are inside or outside string context as appropriate.
- Varnish is now stricter in enforcing no duplication of probes, backends and ACLs.
- varnishncsa now ignores piped requests, since we have no way of knowing their return status.
- The std module now has proper documentation, including a manual page
- The interpretation of bans will change slightly between 3.0 beta 1
and 3.0 release. Currently, doing
ban("req.url == req.url")
will cause the right hand req.url to be interpreted in the context of the request creating the ban. This will change so you will have to doban("req.url == " + req.url)
instead. This syntax already works and is recommended.
- Add streaming on
pass
andmiss
. This is controlled by theberesp.do_stream
boolean. This includes support for compression/uncompression. - Add support for ESI and gzip.
- Handle objects larger than 2G.
- HTTP Range support is now enabled by default
- The ban lurker is enabled by default
- if there is a backend or director with the name
default
, use that as the default backend, otherwise use the first one listed. - Add many more stats counters. Amongst those, add per storage backend stats and per-backend statistics.
- Syslog the platform we are running on
- The
-l
(shared memory log file) argument has been changed, please see the varnishd manual for the new syntax. - The
-S
and-T
arguments are now stored in the shmlog - Fix off-by-one error when exactly filling up the workspace. Bug #693.
- Make it possible to name storage backends. The names have to be unique.
- Update usage output to match the code. Bug #683
- Add per-backend health information to shared memory log.
- Always recreate the shared memory log on startup.
- Add a
vcl_dir
parameter. This is used to resolve relative path names forvcl.load
andinclude
in .vcl files. - Make it possible to specify
-T :0
. This causes varnishd to look for a free port automatically. The port is written in the shared memory log so varnishadm can find it. - Classify locks into kinds and collect stats for each kind, recording the data in the shared memory log.
- Auto-detect necessary flags for pthread support and
VCC_CC
flags. This should make Varnish somewhat happier on Solaris. Bug #663 - The
overflow_max
parameter has been renamed toqueue_max
. - If setting a parameter fails, report which parameter failed as this is not obvious during startup.
- Add a parameter named
shortlived
. Objects whose TTL is less than the parameter go into transient (malloc) storage. - Reduce the default
thread_add_delay
to 2ms. - The
max_esi_includes
parameter has been renamed tomax_esi_depth
. - Hash string components are now logged by default.
- The default connect timeout parameter has been increased to 0.7 seconds.
- The
err_ttl
parameter has been removed and is replaced by a setting in default.vcl. - The default
send_timeout
parameter has been reduced to 1 minute. - The default
ban_lurker
sleep has been set to 10ms. - When an object is banned, make sure to set its grace to 0 as well.
- Add
panic.show
andpanic.clear
CLI commands. - The default
http_resp_hdr_len
andhttp_req_hdr_len
has been increased to 2048 bytes. - If
vcl_fetch
results inrestart
orerror
, close the backend connection rather than fetching the object. - If allocating storage for an object, try reducing the chunk size before evicting objects to make room. Bug #880
- Add
restart
fromvcl_deliver
. Bug #411 - Fix an off-by-up-to-one-minus-epsilon bug where if an object from
the backend did not have a last-modified header we would send out a
304 response which did include a
Last-Modified
header set to when we received the object. However, we would compare the timestamp to the fractional second we got the object, meaning any request with the exact timestamp would get a200
response rather than the correct304
. - Fix a race condition in the ban lurker where a serving thread and the lurker would both look at an object at the same time, leading to Varnish crashing.
- If a backend sends a
Content-Length
header and we are streaming and we are not uncompressing it, send theContent-Length
header on, allowing browsers to display a progress bar. - All storage must be at least 1M large. This is to prevent administrator errors when specifying the size of storage where the admin might have forgotten to specify units.
- Add an
-m $tag:$regex
parameter, used for selecting some transactions. The parameter can be repeated, in which case it is logically and-ed together.
- varnishadm will now pick up the -S and -T arguments from the shared memory log, meaning just running it without any arguments will connect to the running varnish. Bug #875
- varnishadm now accepts an -n argument to specify the location of the shared memory log file
- add libedit support
- reopen shared memory log if the varnishd process is restarted.
- Improve support for selecting some, but not all fields using the
-f
argument. Please see the documentation for further details on the use of-f
. - display per-backend health information
- Report error if called with
-i
and-I
as they do not make any sense for varnishncsa. - Add custom log formats, specified with
-F
. Most of the Apache log formats are supported, as well as some Varnish-specific ones. See the documentation for further information. Bug #712 and bug #485
- add
-l
and-L
switches which leave/tmp/vtc.*
behind on error and unconditionally respectively. - add
-j
parameter to run tests in parallel and use this by default.
- add
-p $period
parameter. The units in varnishtop were previously undefined, they are now in requests/period. The default period is 60 seconds.
- group requests by default. This can be turned off by using
-O
- the
-o
parameter is now a no-op and is ignored.
- Add a std VMOD which includes a random function, log, syslog, fileread, collect,
- Change string concatenation to be done using
+
rather than implicitly. - Stop using
%xx
escapes in VCL strings. - Change
req.hash += value
tohash_data(value)
- Variables in VCL now have distinct read/write access
bereq.connect_timeout
is now available invcl_pipe
.- Make it possible to declare probes outside of a director. Please see the documentation on how to do this.
- The VCL compiler has been reworked greatly, expanding its abilities with regards to what kinds of expressions it understands.
- Add
beresp.backend.name
,beresp.backend.ip
andberesp.backend.port
variables. They are only available fromvcl_fetch
and are read only. Bug #481 - The default VCL now calls pass for any objects where
beresp.http.Vary == "*"
. Bug #787 - The
log
keyword has been moved to thestd
VMOD. - It is now possible to choose which storage backend to be used
- Add variables
storage.$name.free_space
,storage.$name.used_space
andstorage.$name.happy
- The variable
req.can_gzip
tells us whether the client accepts gzipped objects or not. purge
is now calledban
, since that is what it really is and has always been.req.esi_level
is now available. Bug #782- esi handling is now controlled by the
beresp.do_esi
boolean rather than theesi
function. beresp.do_gzip
andberesp.do_gunzip
now control whether an uncompressed object should be compressed and a compressed object should be uncompressed in the cache.- make it possible to control compression level using the
gzip_level
parameter. obj.cacheable
andberesp.cacheable
have been removed. Cacheability is now solely through theberesp.ttl
andberesp.grace
variables.- setting the
obj.ttl
orberesp.ttl
to zero now also sets the corresponding grace to zero. If you want a non-zero grace, set grace after setting the TTL. return(pass)
invcl_fetch
has been renamed toreturn(hit_for_pass)
to make it clear that pass invcl_fetch
andvcl_recv
are different beasts.- Add actual purge support. Doing
purge
will remove an object and all its variants.
libvarnishapi
has been overhauled and the API has been broken. Please see git commit logs and the support tools to understand what's been changed.- Add functions to walk over all the available counters. This is needed because some of the counter names might only be available at runtime.
- Limit the amount of time varnishapi waits for a shared memory log to appear before returning an error.
- All libraries but
libvarnishapi
have been moved to a private directory as they are not for public consumption and have no ABI/API guarantees.
- Python is now required to build
- Varnish Cache is now consistently named Varnish Cache.
- The compilation process now looks for kqueue on NetBSD
- Make it possible to use a system jemalloc rather than the bundled version.
- The documentation has been improved all over and should now be in much better shape than before
- On pass from vcl_recv, we did not remove the backends Content-Length header before adding our own. This could cause confusion for browsers and has been fixed.
- Make pass with content-length work again. An issue with regards to 304, Content-Length and pass has been resolved.
- An issue relating to passed requests with If-Modified-Since headers has been fixed. Varnish did not recognize that the 304-response did not have a body.
- A potential lock-inversion with the ban lurker thread has been resolved.
- Several build-dependency issues relating to rst2man have been fixed. Varnish should now build from source without rst2man if you are using tar-balls.
- Ensure Varnish reads the expected last CRLF after chunked data from the backend. This allows re-use of the connection.
- Remove a GNU Make-ism during make dist to make BSD happier.
- Document the log, set, unset, return and restart statements in the VCL documentation.
- Fix an embarrassingly old bug where Varnish would run out of workspace when requests come in fast over a single connection, typically during synthetic benchmarks.
- Varnish will now allow If-Modified-Since requests to objects without a Last-Modified-header, and instead use the time the object was cached instead.
- Do not filter out Content-Range headers in pass.
- Require -d, -b, -f, -S or -T when starting varnishd. In human terms, this means that it is legal to start varnishd without a Vcl or backend, but only if you have a CLI channel of some kind.
- Don't suppress Cache-Control headers in pass responses.
- Merge multi-line Cache-Control and Vary header fields. Until now, no browsers have needed this, but Chromium seems to find it necessary to spread its Cache-Control across two lines, and we get to deal with it.
- Make new-purge not touch busy objects. This fixes a potential crash when calling VRT_purge.
- If there are several grace-able objects, pick the least expired one.
- Fix an issue with varnishadm -T :6082 shorthand.
- Add bourn-shell like "here" documents on the CLI. Typical usage: vcl.inline vcl_new << 42 backend foo {...} sub vcl_recv {...} 42
- Add CLI version to the CLI-banner, starting with version 1.0 to mark here-documents.
- Fix a problem with the expiry thread slacking off during high load.
- Remove no longer existing -L option.
- An embarrassing typo in the new binary heap layout caused inflated obj/objcore/objhdr counts and could cause odd problems when the LRU expunge mechanism was invoked. This has been fixed.
- We now have updated documentation in the reStructuredText format. Manual pages and reference documentation are both built from this.
- We now include a DNS director which uses DNS for choosing which backend to route requests to. Please see the documentation for more details.
- If you restarted a request, the HTTP header X-Forwarded-For would be updated multiple times. This has been fixed.
- If a VCL contained a % sign, and the vcl.show CLI command was used, varnishd would crash. This has been fixed.
- When doing a pass operation, we would remove the Content-Length, Age and Proxy-Auth headers. We are no longer doing this.
- now has a string representation, making it easier to construct Expires headers in VCL.
- In a high traffic environment, we would sometimes reuse a file descriptor before flushing the logs from a worker thread to the shared log buffer. This would cause confusion in some of the tools. This has been fixed by explicitly flushing the log when a backend connection is closed.
- If the communication between the management and the child process gets out of sync, we have no way to recover. Previously, varnishd would be confused, but we now just kill the child and restart it.
- If the backend closes the connection on us just as we sent a request to it, we retry the request. This should solve some interoperability problems with Apache and the mpm-itk multi processing module.
- varnishd now only provides help output the current CLI session is authenticated for.
- If the backend does not tell us which length indication it is using, we now assume the resource ends EOF at.
- The client director now has a variable client.identity which is used to choose which backend should receive a given request.
- The Solaris port waiter has been updated, and other portability fixes for Solaris.
- There was a corner case in the close-down processing of pipes, this has now been fixed.
- Previously, if we stopped polling a backend which was sick, it never got marked as healthy. This has now been changed.
- It is now possible to specify ports as part of the .host field in VCL.
- The synthetic counters were not locked properly, and so the sms_ counters could underflow. This has now been fixed.
- The value of obj.status as a string in vcl_error would not be correct in all cases. This has been fixed.
- Varnish would try to trim storage segments completely filled when using the malloc stevedore and the object was received chunked encoding. This has been fixed.
- If a buggy backend sends us a Vary header with two colons, we would previously abort. We now rather fix this up and ignore the extra colon.
- req.hash_always_miss and req.hash_ignore_busy has been added, to make preloading or periodically refreshing content work better.
- varnishncsa would in some cases be confused by ESI requests and output invalid lines. This has now been fixed.
- varnishlog now allows -o and -u together.
- varnishtop would crash on 32 bit architectures. This has been fixed.
- Regex inclusion and exclusion had problems with matching particular parts of the string being matched. This has been fixed.
- Improve scalability of critbit.
- The critbit hash algorithm has now been tightened to make sure the tree is in a consistent state at all points, and the time we wait for an object to cool off after it is eligible for garbage collection has been tweaked.
- Add log command to VCL. This emits a VCL_log entry into the shared memory log.
- Only emit Length and ReqEnd log entries if we actually have an XID. This should get rid of some empty log lines in varnishncsa.
- Destroy directors in a predictable fashion, namely reverse of creation order.
- Fix bug when ESI elements spanned storage elements causing a panic.
- In some cases, the VCL compiler would panic instead of giving sensible messages. This has now been fixed.
- Correct an off-by-one error when the requested range exceeds the size of an object.
- Handle requests for the end of an object correctly.
- Allow tabulator characters in the third field of the first line of HTTP requests
- On Solaris, if the remote end sends us an RST, all system calls related to that socket will return EINVAL. We now handle this better.
- The -X parameter didn't work correctly. This has been fixed.
- When adding Range support for 2.1.1, we accidentally introduced a bug which would append garbage to objects larger than the chunk size, by default 128k. Browsers would do the right thing due to Content-Length, but some load balancers would get very confused.
- The changelog in 2.1.0 included syntax errors, causing the generated changelog to be empty.
- The help text for default_grace was wrongly formatted and included a syntax error. This has now been fixed.
- varnishd now closes the file descriptor used to read the management secret file (from the -S parameter).
- The child would previously try to close every valid file descriptor, something which could cause problems if the file descriptor ulimit was set too high. We now keep track of all the file descriptors we open and only close up to that number.
- ESI was partially broken in 2.1.0 due to a bug in the rollback of session workspace. This has been fixed.
- Reject the authcommand rather than crash if there is no -S parameter given.
- Align pointers in allocated objects. This will in theory make Varnish a tiny bit faster at the expense of slightly more memory usage.
- Ensure the master process PID is updated in the shared memory log file after we go into the background.
- HEAD requests would be converted to GET requests too early, which affected pass and pipe. This has been fixed.
- Update the documentation to point out that the TTL is no longer taken into account to decide whether an object is cacheable or not.
- Add support for completely obliterating an object and all variants of it. Currently, this has to be done using inline C.
- Add experimental support for the Range header. This has to be enabled using the parameter http_range_support.
- The critbit hasher could get into a deadlock and had a race condition. Both those have now been fixed.
varnishsizes -----------~
- varnishsizes, which is like varnishhist, but for the length of objects, has been added..
Persistent storage is now experimentally supported using the persistent stevedore. It has the same command line arguments as the file stevedore.
obj.* is now called beresp.* in vcl_fetch, and obj.* is now read-only.
The regular expression engine is now PCRE instead of POSIX regular expressions.
req.* is now available in vcl_deliver.
Add saint mode where we can attempt to grace an object if we don't like the backend response for some reason.
Related, add saintmode_threshold which is the threshold for the number of objects to be added to the trouble list before the backend is considered sick.
Add a new hashing method called critbit. This autoscales and should work better on large object workloads than the classic hash. Critbit has been made the default hash algorithm.
When closing connections, we experimented with sending RST to free up load balancers and free up threads more quickly. This caused some problems with NAT routers and so has been reverted for now.
Add thread that checks objects against ban list in order to prevent ban list from growing forever. Note that this needs purges to be written so they don't depend on req.*. Enabled by setting ban_lurker_sleep to a nonzero value.
The shared memory log file format was limited to maximum 64k simultaneous connections. This is now a 32 bit field which removes this limitation.
Remove obj_workspace, this is now sized automatically.
Rename acceptors to waiters
vcl_prefetch has been removed. It was never fully implemented.
Add support for authenticating CLI connections.
Add hash director that chooses which backend to use depending on req.hash.
Add client director that chooses which backend to use depending on the client's IP address. Note that this ignores the X-Forwarded-For header.
varnishd now displays a banner by default when you connect to the CLI.
Increase performance somewhat by moving statistics gathering into a per-worker structure that is regularly flushed to the global stats.
Make sure we store the header and body of object together. This may in some cases improve performance and is needed for persistence.
Remove client-side address accounting. It was never used for anything and presented a performance problem.
Add a timestamp to bans, so you can know how old they are.
Quite a few people got confused over the warning about not being able to lock the shared memory log into RAM, so stop warning about that.
Change the default CLI timeout to 10 seconds.
We previously forced all inserts into the cache to be GET requests. This has been changed to allow POST as well in order to be able to implement purge-on-POST semantics.
The CLI command stats now only lists non-zero values.
The CLI command stats now only lists non-zero values.
Use daemon(3) from libcompat on Darwin.
Remove vcl_discard as it causes too much complexity and never actually worked particularly well.
Remove vcl_timeout as it causes too much complexity and never actually worked particularly well.
Update the documentation so it refers to sess_workspace, not http_workspace.
Document the -i switch to varnishd as well as the server.identity and server.hostname VCL variables.
purge.hash is now deprecated and no longer shown in help listings.
When processing ESI, replace the five mandatory XML entities when we encounter them.
Add string representations of time and relative time.
Add locking for n_vbe_conn to make it stop underflowing.
When ESI-processing content, check for illegal XML character entities.
Varnish can now connect its CLI to a remote instance when starting up, rather than just being connected to.
It is no longer needed to specify the maximum number of HTTP headers to allow from backends. This is now a run-time parameter.
The X-Forwarded-For header is now generated by vcl_recv rather than the C code.
It is now possible to not send all CLI traffic to syslog.
It is now possible to not send all CLI traffic to syslog.
In the case of varnish crashing, it now outputs a identifying string with the OS, OS revision, architecture and storage parameters together with the backtrace.
Use exponential backoff when we run out of file descriptors or sessions.
Allow setting backend timeouts to zero.
Count uptime in the shared memory log.
Try to detect the case of two running varnishes with the same shmlog and storage by writing the master and child process ids to the shmlog and refusing to start if they are still running.
Make sure to use EOF mode when serving ESI content to HTTP/1.0 clients.
Make sure we close the connection if it either sends Connection: close or it is a HTTP/1.0 backend that does not send Connection: keep-alive.
Increase the default session workspace to 64k on 64-bit systems.
Make the epoll waiter use level triggering, not edge triggering as edge triggering caused problems on very busy servers.
Handle unforeseen client disconnections better on Solaris.
Make session lingering apply to new sessions, not just reused sessions.
- Make use of the new uptime field in the shared memory log rather than synthesizing it from the start time.
- Exit at the end of the file when started with -d.
- varnishadm can now have a timeout when trying to connect to the running varnishd.
- varnishadm now knows how to respond to the secret from a secured varnishd
- 2.0.5 had an off-by-one error in the ESI handling causing includes to fail a large part of the time. This has now been fixed.
- Try harder to not confuse backends when sending them backend probes. We half-closed the connection, something some backends thought meant we had dropped the connection. Stop doing so, and add the capability for specifying the expected response code.
- In 2.0.5, session lingering was turned on. This caused statistics to not be counted often enough in some cases. This has now been fixed.
- Avoid triggering an assert if the other end closes the connection while we are lingering and waiting for another request from them.
- When generating backtraces, prefer the built-in backtrace function if such exists. This fixes a problem compiling 2.0.5 on Solaris.
- Make it possible to specify the per-thread stack size. This might be useful on 32 bit systems with their limited address space.
- Document the -C option to varnishd.
- Handle object workspace overruns better.
- Allow turning off ESI processing per request by using set req.esi = off.
- Tell the kernel that we expect to use the mmap-ed file in a random fashion. On Linux, this turns off/down readahead and increases performance.
- Make it possible to change the maximum number of HTTP headers we allow by passing --with-max-header-fields=NUM rather than changing the code.
- Implement support for HTTP continuation lines.
- Change how connections are closed and only use SO_LINGER for orderly connection closure. This should hopefully make worker threads less prone to hangups on network problems.
- Handle multi-element purges correctly. Previously we ended up with parse errors when this was done from VCL.
- Handle illegal responses from the backend better by serving a 503 page rather than panic-ing.
- When we run into an assertion that is not true, Varnish would previously dump a little bit of information about itself. Extend that information with a backtrace. Note that this relies on the varnish binary being unstripped.
- Add a session_max parameter that limits the maximum number of sessions we keep open before we start dropping new connections summarily.
- Try to consume less memory when doing ESI processing by properly rolling back used workspace after processing an object. This should make it possible to turn sess_workspace quite a bit for users with ESI-heavy pages.
- Turn on session_linger by default. Tests have shown that session_linger helps a fair bit with performance.
- Rewrite the epoll acceptor for better performance. This should lead to both higher processing rates and maximum number of connections on Linux.
- Add If-None-Match support, this gives significant bandwidth savings for users with compliant browsers.
- RFC2616 specifies that ETag, Content-Location, Expires, Cache-Control and Vary should be emitted when delivering a response with the 304 response code.
- Various fixes which makes Varnish compile and work on AIX.
- Turn on TCP_DEFER_ACCEPT on Linux. This should make us less susceptible to denial of service attacks as well as give us slightly better performance.
- Add an .initial property to the backend probe specification. This is the number of good probes we pretend to have seen. The default is one less than .threshold, which means the first probe will decide if we consider the backend healthy.
- Make it possible to compare strings against other string-like objects, not just plain strings. This allows you to compare two headers, for instance.
- When support for restart in vcl_error was added, there was no check to prevent infinite recursion. This has now been fixed.
- Turn on purge_dups by default. This should make us consume less memory when there are many bans for the same pattern added.
- Add a new log tag called FetchError which tries to explain why we could not fetch an object from the backend.
- Change the default srcaddr_ttl to 0. It is not used by anything and has been removed in the development version. This will increase performance somewhat.
- varnishtop did not handle variable-length log fields correctly. This is now fixed.
- varnishtop previously did not print the name of the tag, which made it very hard to understand. We now print out the tag name.
- Make Varnish more portable by pulling in fixes for Solaris and NetBSD.
- Correct description of -a in the manual page.
- Ensure we are compiling in C99 mode.
- If error was called with a null reason, we would crash on Solaris. Make sure this no longer happens.
- Varnish used to crash if you asked it to use a nonexistent waiter. This has now been fixed.
- Add documentation to the default VCL explaining that using Connection: close in vcl_pipe is generally a good idea.
- Add minimal facility for dealing with TELNET option negotiation by returning WONT to DO and DONT requests.
- If the backend is unhealthy, use a graced object if one is available.
- Make server.hostname and server.identity available to VCL. The latter can be set with the -i parameter to varnishd.
- Make restart available from vcl_error.
- Previously, only the TTL of an object was considered in whether it would be marked as cacheable. This has been changed to take the grace into consideration as well.
- Previously, if an included ESI fragment had a zero size, we would send out a zero-sized chunk which signifies end-of-transmission. We now ignore zero-sized chunks.
- We accidentally slept for far too long when we reached the maximum number of open file descriptors. This has been corrected and accept_fd_holdoff now works correctly.
- Previously, when ESI processing, we did not look at the full length, but stopped at the first NULL byte. We no longer do that, enabling ESI processing of binary data.
- Make sure system "..." returns successfully to ensure test failures do not go unnoticed.
- Make it possible to send NULL bytes through the testing framework.
- Handle If-Modified-Since and ESI sub-objects better, fixing a problem where we sometimes neglected to insert included objects.
- restart in vcl_hit is now supported.
- Setting the TTL of an object to 0 seconds would sometimes cause it to be delivered for up to one second - epsilon. This has been corrected and we should now never deliver those objects to other clients.
- The malloc storage backend now prints the maximum storage size, just like the file backend.
- Various small documentation bugs have been fixed.
- Varnish did not set a default interval for backend probes, causing it to poll the backend continuously. This has been corrected.
- Allow "true" and "false" when setting boolean parameters, in addition to on/off, enable/disable and yes/no.
- Default to always talking HTTP 1.1 with the backend.
- Varnish did not make sure the file it was loading was a regular file. This could cause Varnish to crash if it was asked to load a directory or other non-regular file. We now check that the file is a regular file before loading it.
- The binary heap used for expiry processing had scalability problems. Work around this by using stripes of a fixed size, which should make this scale better, particularly when starting up and having lots of objects.
- When we imported the jemalloc library into the Varnish tree, it did not compile without warnings. This has now been fixed.
- Varnish took a very long time to detect that the backend did not respond. To remedy this, we now have read timeouts in addition to the connect timeout. Both the first_byte_timeout and the between_bytes_timeout defaults to 60 seconds. The connect timeout is no longer in milliseconds, but rather in seconds.
- Previously, the VCL to C conversion as well as the invocation of the C compiler was done in the management process. This is now done in a separate sub-process. This prevents any bugs in the VCL compiler from affecting the management process.
- Chunked encoding headers were counted in the statistics for header bytes. They no longer are.
- ESI processed objects were not counted in the statistics for body bytes. They now are.
- It is now possible to adjust the maximum record length of log entries in the shmlog by tuning the shm_reclen parameter.
- The management parameters listed in the CLI were not sorted, which made it hard to find the parameter you were looking for. They are now sorted, which should make this easier.
- Add a new hashing type, "critbit", which uses a lock-less tree based lookup algorithm. This is experimental and should not be enabled in production environments without proper testing.
- The session workspace had a default size of 8k. It is now 16k, which should make VCLs where many headers are processed less prone to panics.
- We have seen that people seem to be confused as to which actions in the different VCL functions return and which ones don't. Add a new syntax return(action) to make this more explicit. The old syntax is still supported.
- Varnish would return an error if any of the management IPs listed in the -T parameter could not be listened to. We now only return an error if none of them can be listened to.
- In the case of the backend or client giving us too many parameters, we used to just ignore the overflowing headers. This is problematic if you end up ignoreing Content-Length, Transfer-Encoding and similar headers. We now give out a 400 error to the client if it sends us too many and 503 if we get too many from the backend.
- We used panic if we got a too large chunked header. This behaviour has been changed into just failing the transaction.
- Varnish now supports an extended purge method where it is possible to do purge req.http.host ~ "web1.com" && req.url ~ "\.png" and similar. See the documentation for details.
- Under heavy load, Varnish would sometimes crash when trying to update the per-request statistics. This has now been fixed.
- It is now possible to not save the hash string in the session and object workspace. This will save a lot of memory on sites with many small objects. Disabling the purge_hash parameter also disables the purge.hash facility.
- Varnish now supports !~ as a "no match" regular expression matcher.
- In some cases, you could get serialised access to "pass" objects. We now make it default to the default_ttl value; this can be overridden in vcl_fetch.
- Varnish did not check the syntax of regsub calls properly. More checking has been added.
- If the client closed the connection while Varnish was processing ESI elements, Varnish would crash while trying to write the object to the client. We now check if the client has closed the connection.
- The ESI parser had a bug where it would crash if an XML comment would span storage segments. This has been fixed.
VCL Manual page --------------~
- The documentation on how capturing parentheses work was wrong. This has been corrected.
- Grace has now been documented.
- varnishreplay did not work correctly on Linux, due to a too small stack. This has now been fixed.
- In high-load situations, when using ESI, varnishd would sometimes mishandle objects and crash. This has been worked around.
- varnishreplay did not work correctly on Linux, due to a too small stack. This has now been fixed.
- When receiving a garbled HTTP request, varnishd would sometimes crash. This has been fixed.
- There was an off-by-one error in the ACL compilation. Now fixed.
Red Hat spec file ----------------~
- A typo in the spec file made the .rpm file names wrong.
- Only look for sendfile on platforms where we know how to use it, which is FreeBSD for now.
- Make it possible to adjust the shared memory log size and bump the size from 8MB to 80MB.
- Fix up the handling of request bodies to better match what RFC2616 mandates. This makes PUT, DELETE, OPTIONS and TRACE work in addition to POST.
- Change how backends are defined, to a constant structural definition style. See https://www.varnish-cache.org/wiki/VclSyntaxChanges for the details.
- Add directors, which wrap backends. Currently, there's a random director and a round-robin director.
- Add "grace", which is for how long and object will be served, even after it has expired. To use this, both the object's and the request's grace parameter need to be set.
- Manual pages have been updated for new VCL syntax and varnishd options.
- Man pages and other docs have been updated.
- The shared memory log file is now locked in memory, so it should not be paged out to disk.
- We now handle Vary correctly, as well as Expect.
- ESI include support is implemented.
- Make it possible to limit how much memory the malloc uses.
- Solaris is now supported.
- There is now a regsuball function, which works like regsub except it replaces all occurrences of the regex, not just the first.
- Backend and director declarations can have a .connect_timeout parameter, which tells us how long to wait for a successful connection.
- It is now possible to select the acceptor to use by changing the acceptor parameter.
- Backends can have probes associated with them, which can be checked with req.backend.health in VCL as well as being handled by directors which do load-balancing.
- Support larger-than-2GB files also on 32 bit hosts. Please note that this does not mean we can support caches bigger than 2GB, it just means logfiles and similar can be bigger.
- In some cases, we would remove the wrong header when we were stripping Content-Transfer-Encoding headers from a request. This has been fixed.
- Backends can have a .max_connections associated with them.
- On Linux, we need to set the dumpable bit on the child if we want core dumps. Make sure it's set.
- Doing purge.hash() with an empty string would cause us to dump core. Fixed so we don't do that anymore.
- We ran into a problem with glibc's malloc on Linux where it seemed like it failed to ever give memory back to the OS, causing the system to swap. We have now switched to jemalloc which appears not to have this problem.
- max_restarts was never checked, so we always ended up running out of workspace. Now, vcl_error is called when we reach max_restarts.
- varnishtest is a tool to do correctness tests of varnishd. The test suite is run by using make check.
- We now set the field widths dynamically based on the size of the terminal and the name of the longest field.
- varnishstat -1 now displays the uptime too.
- varnishncsa now does fflush after each write. This makes tail -f work correctly, as well as avoiding broken lines in the log file.
- It is possible to get varnishncsa to output the X-Forwarded-For instead of the client IP by passing -f to it.
Build system -----------~
- Various sanity checks have been added to configure, it now complains about no ncurses or if SO_RCVTIMEO or SO_SNDTIMEO are non-functional. It also aborts if there's no working acceptor mechanism
- The C compiler invocation is decided by the configure script and can now be overridden by passing VCC_CC when running configure.
- When switching to a new VCL configuration, a race condition exists which may cause Varnish to reference a backend which no longer exists (see ticket #144). This race condition has not been entirely eliminated, but it should occur less frequently.
- When dropping a TCP session before any requests were processed, an assertion would be triggered due to an uninitialized timestamp (see ticket #132). The timestamp is now correctly initialized.
- Varnish will now correctly generate a Date: header for every response instead of copying the one it got from the backend (see ticket #157).
- Comparisons in VCL which involve a nonexistent string (usually a header which is not present in the request or object being processed) would cause a NULL pointer dereference; now the comparison will simply fail.
- A bug in the VCL compiler which would cause a double-free when processing include directives has been fixed.
- A resource leak in the worker thread management code has been fixed.
- When connecting to a backend, Varnish will usually get the address from a cache. When the cache is refreshed, existing connections may end up with a reference to an address structure which no longer exists, resulting in a crash. This race condition has been somewhat mitigated, but not entirely eliminated (see ticket #144.)
- Varnish will now pass the correct protocol version in pipe mode: the backend will get what the client sent, and vice versa.
- The core of the pipe mode code has been rewritten to increase robustness and eliminate spurious error messages when either end closes the connection in a manner Varnish did not anticipate.
- A memory leak in the backend code has been plugged.
- When using the kqueue acceptor, if a client shuts down the request side of the connection (as many clients do after sending their final request), it was possible for the acceptor code to receive the EOF event and recycle the session while the last request was still being serviced, resulting in a assertion failure and a crash when the worker thread later tried to delete the session. This should no longer happen (see ticket #162.)
- A mismatch between the recorded length of a cached object and the amount of data actually present in cache for that object can occasionally occur (see ticket #167.) This has been partially fixed, but may still occur for error pages generated by Varnish when a problem arises while retrieving an object from the backend.
- Some socket-related system calls may return unexpected error codes when operating on a TCP connection that has been shut down at the other end. These error codes would previously cause assertion failures, but are now recognized as harmless conditions.
- Pressing 0 though 9 while varnishhist is running will change the refresh interval to the corresponding power of two, in seconds.
- The varnishncsa tool can now daemonize and write a PID file like varnishlog, using the same command-line options. It will also reopen its output upon receipt of a SIGHUP if invoked with -w.
- Pressing 0 though 9 while varnishstat is running will change the refresh interval to the corresponding power of two, in seconds.
Build system -----------~
- Varnish's <queue.h> has been modified to avoid conflicts with <sys/queue.h> on platforms where the latter is included indirectly through system headers.
- Several steps have been taken towards Solaris support, but this is not yet complete.
- When configure was run without an explicit prefix, Varnish's idea of the default state directory would be garbage and a state directory would have to be specified manually with -n. This has been corrected.
- The code required to allow VCL to read obj.status, which had accidentally been left out, has now been added.
- Varnish will now always include a Connection: header in its reply to the client, to avoid possible misunderstandings.
- A bug that triggered an assertion failure when generating synthetic error documents has been corrected.
- A new VCL function, purge_url, provides the same functionality as the url.purge management command.
- Previously, Varnish assumed that the response body should be sent only if the request method was GET. This was a problem for custom request methods (such as PURGE), so the logic has been changed to always send the response body except in the specific case of a HEAD request.
- Changes to run-time parameters are now correctly propagated to the child process.
- Due to the way run-time parameters are initialized at startup, varnishd previously required the nobody user and the nogroup group to exist even if a different user and group were specified on the command line. This has been corrected.
- Under certain conditions, the VCL compiler would carry on after a syntax error instead of exiting after reporting the error. This has been corrected.
- The manner in which the hash string is assembled has been modified to reduce memory usage and memory-to-memory copying.
- Before calling vcl_miss, Varnish assembles a tentative request object for the backend request which will usually follow. This object would be leaked if vcl_miss returned anything else than fetch. This has been corrected.
- The code necessary to handle an error return from vcl_fetch and vcl_deliver had inadvertantly been left out. This has been corrected.
- Varnish no longer prints a spurious "child died" message (the result of reaping the compiler process) after compiling a new VCL configuration.
- Under some circumstances, due to an error in the workspace management code, Varnish would lose the "tail" of a request, i.e. the part of the request that has been received from the client but not yet processed. The most obvious symptom of this was that POST requests would work with some browsers but not others, depending on details of the browser's HTTP implementation. This has been corrected.
- On some platforms, due to incorrect assumptions in the CLI code, the management process would crash while processing commands received over the management port. This has been corrected.
Build system -----------~
- The top-level Makefile will now honor $DESTDIR when creating the state directory.
- The Debian and RedHat packages are now split into three (main / lib / devel) as is customary.
- A number of compile-time and run-time portability issues have been addressed.
- The autogen.sh script had workarounds for problems with the GNU autotools on FreeBSD; these are no longer needed and have been removed.
- The libcompat library has been renamed to libvarnishcompat and is now dynamic rather than static. This simplifies the build process and resolves an issue with the Mac OS X linker.
- Readability of the C source code generated from VCL code has been improved.
- Equality (==) and inequality (!=) operators have been implemented for IP addresses (which previously could only be compared using ACLs).
- The address of the listening socket on which the client connection was received is now available to VCL as the server.ip variable.
- Each object's hash key is now computed based on a string which is available to VCL as req.hash. A VCL hook named vcl_hash has been added to allow VCL scripts to control hash generation (for instance, whether or not to include the value of the Host: header in the hash).
- The setup code for listening sockets has been modified to detect and handle situations where a host name resolves to multiple IP addresses. It will now attempt to bind to each IP address separately, and report a failure only if none of them worked.
- Network or protocol errors that occur while retrieving an object from a backend server now result in a synthetic error page being inserted into the cache with a 30-second TTL. This should help avoid driving an overburdened backend server into the ground by repeatedly requesting the same object.
- The child process will now drop root privileges immediately upon startup. The user and group to use are specified with the user and group run-time parameters, which default to nobody and nogroup, respectively. Other changes have been made in an effort to increase the isolation between parent and child, and reduce the impact of a compromise of the child process.
- Objects which are received from the backend with a Vary: header are now stored separately according to the values of the headers specified in Vary:. This allows Varnish to correctly cache e.g. compressed and uncompressed versions of the same object.
- Each Varnish instance now has a name, which by default is the host name of the machine it runs on, but can be any string that would be valid as a relative or absolute directory name. It is used to construct the name of a directory in which the server state as well as all temporary files are stored. This makes it possible to run multiple Varnish instances on the same machine without conflict.
- When invoked with the -C option, varnishd will now not just translate the VCL code to C, but also compile the C code and attempt to load the resulting shared object.
- Attempts by VCL code to reference a variable outside its scope or to assign a value to a read-only variable will now result in compile-time rather than run-time errors.
- The new command-line option -F will make varnishd run in the foreground, without enabling debugging.
- New VCL variables have been introduced to allow inspection and manipulation of the request sent to the backend (bereq.request, bereq.url, bereq.proto and bereq.http) and the response to the client (resp.proto, resp.status, resp.response and resp.http).
- Statistics from the storage code (including the amount of data and free space in the cache) are now available to varnishstat and other statistics-gathering tools.
- Objects are now kept on an LRU list which is kept loosely up-to-date (to within a few seconds). When cache runs out, the objects at the tail end of the LRU list are discarded one by one until there is enough space for the freshly requested object(s). A VCL hook, vcl_discard, is allowed to inspect each object and determine its fate by returning either keep or discard.
- A new VCL hook, vcl_deliver, provides a chance to adjust the response before it is sent to the client.
- A new management command, vcl.show, displays the VCL source code of any loaded configuration.
- A new VCL variable, now, provides VCL scripts with the current time in seconds since the epoch.
- A new VCL variable, obj.lastuse, reflects the time in seconds since the object in question was last used.
- VCL scripts can now add an HTTP header (or modify the value of an existing one) by assigning a value to the corresponding variable, and strip an HTTP header by using the remove keyword.
- VCL scripts can now modify the HTTP status code of cached objects (obj.status) and responses (resp.status)
- Numeric and other non-textual variables in VCL can now be assigned to textual variables; they will be converted as needed.
- VCL scripts can now apply regular expression substitutions to textual variables using the regsub function.
- A new management command, status, returns the state of the child.
- Varnish will now build and run on Mac OS X.
- This is a new utility which sends a single command to a Varnish server's management port and prints the result to stdout, greatly simplifying the use of the management port from scripts.
- The user interface has been greatly improved; the histogram will be automatically rescaled and redrawn when the window size changes, and it is updated regularly rather than at a rate dependent on the amount of log data gathered. In addition, the name of the Varnish instance being watched is displayed in the upper right corner.
- In addition to client traffic, varnishncsa can now also process log data from backend traffic.
- A bug that would cause varnishncsa to segfault when it encountered an empty HTTP header in the log file has been fixed.
- This new utility will attempt to recreate the HTTP traffic which resulted in the raw Varnish log data which it is fed.
- Don't print lifetime averages when it doesn't make any sense, for instance, there is no point in dividing the amount in bytes of free cache space by the lifetime in seconds of the varnishd process.
- The user interface has been greatly improved; varnishstat will no longer print more than fits in the terminal, and will respond correctly to window resize events. The output produced in one-shot mode has been modified to include symbolic names for each entry. In addition, the name of the Varnish instance being watched is displayed in the upper right corner in curses mode.
- The user interface has been greatly improved; varnishtop will now respond correctly to window resize events, and one-shot mode (-1) actually works. In addition, the name of the Varnish instance being watched is displayed in the upper right corner in curses mode.
The request workflow has been redesigned to simplify request processing and eliminate code duplication. All codepaths which need to speak HTTP now share a single implementation of the protocol. Some new VCL hooks have been added, though they aren't much use yet. The only real user-visible change should be that Varnish now handles persistent backend connections correctly (see ticket #56).
Support for multiple listen addresses has been added.
An "include" facility has been added to VCL, allowing VCL code to pull in code fragments from multiple files.
Multiple definitions of the same VCL function are now concatenated into one in the order in which they appear in the source. This simplifies the mechanism for falling back to the built-in default for cases which aren't handled in custom code, and facilitates modularization.
The code used to format management command arguments before passing them on to the child process would underestimate the amount of space needed to hold each argument once quotes and special characters were properly escaped, resulting in a buffer overflow. This has been corrected.
The VCL compiler has been overhauled. Several memory leaks have been plugged, and error detection and reporting has been improved throughout. Parts of the compiler have been refactored to simplify future extension of the language.
A bug in the VCL compiler which resulted in incorrect parsing of the decrement (-=) operator has been fixed.
A new -C command-line option has been added which causes varnishd to compile the VCL code (either from a file specified with -f or the built-in default), print the resulting C code and exit.
When processing a backend response using chunked encoding, if a chunk header crosses a read buffer boundary, read additional bytes from the backend connection until the chunk header is complete.
A new ping_interval run-time parameter controls how often the management process checks that the worker process is alive.
A bug which would cause the worker process to dereference a NULL pointer and crash if the backend did not respond has been fixed.
In some cases, such as when they are used by AJAX applications to circumvent Internet Explorer's over-eager disk cache, it may be desirable to cache POST requests. However, the code path responsible for delivering objects from cache would only transmit the response body when replying to a GET request. This has been extended to also apply to POST.
This should be revisited at a later date to allow VCL code to control whether the body is delivered.
Varnish now respects Cache-control: s-maxage, and prefers it to Cache-control: max-age if both are present.
This should be revisited at a later date to allow VCL code to control which headers are used and how they are interpreted.
When loading a new VCL script, the management process will now load the compiled object to verify that it links correctly before instructing the worker process to load it.
A new -P command-line options has been added which causes varnishd to create a PID file.
The sendfile_threshold run-time parameter's default value has been set to infinity after a variety of sendfile()-related bugs were discovered on several platforms.
- When grouping log entries by request, varnishlog attempts to collapse the log entry for a call to a VCL function with the log entry for the corresponding return from VCL. When two VCL calls were made in succession, varnishlog would incorrectly omit the newline between the two calls (see ticket #95).
- New -D and -P command-line options have been added to daemonize and create a pidfile, respectively.
- The flag that is raised upon reception of a SIGHUP has been marked volatile so it will not be optimized away by the compiler.
The formatting callback has been largely rewritten for clarity, robustness and efficiency.
If a request included a Host: header, construct and output an absolute URL. This makes varnishncsa output from servers which handle multiple virtual hosts far more useful.
The flag that is raised upon reception of a SIGHUP has been marked volatile so it will not be optimized away by the compiler.
- The documentation, especially the VCL documentation, has been greatly extended and improved.
- The name and location of the curses or ncurses library is now correctly detected by the configure script instead of being hardcoded into affected Makefiles. This allows Varnish to build correctly on a wider range of platforms.
- Compatibility shims for clock_gettime() are now correctly applied where needed, allowing Varnish to build on Mac OS X.
- The autogen.sh script will now correctly detect and warn about automake versions which are known not to work correctly.