- 11 Jan, 2021 21 commits
-
-
Dridi Boukelmoune authored
When gauges are incremented and decremented by different threads, there is a chance that decrements are published first, provoking an underflow of the VSC. Values with the MSB set are considered underflowed, adjusted to zero instead.
-
Martin Blix Grydeland authored
If the DBG_VCLREL is in effect and there are unpushed pool stats, make sure that some thread is waking up to perform the late push. This should help with stability for VTC test cases using the DBG_VCLREL flag.
-
Martin Blix Grydeland authored
Often in test cases the siutation comes where multiple threads go idle at the same time, and no new activity happens after that. This would potentially create the situation where the last thread to go idle sees that some thread is currently pushing stats to global, so it leaves its stats contribution on the pool stats to avoid contention. But without new activity in the future, the pool stats may stay in the pool accumulator indefinitely. This patch adds a check to see if there are unaccumulated statistics lingering in the pool accumulator when a thread wakes after idling to release its VCL reference. If there are, the thread takes on the task of pushing the pool stats to the global stats. This should help with test case stability, and potentially help with underflowed stats reported by some users.
-
Nils Goroll authored
For a red-black tree insert in vrt_priv_dynamic(), we performed a lookup and then an insert, resulting in basically the same tree traversal twice. We now prepare a new struct vrt_priv on the workspace and release it if the respective priv already existed on the tree. For a full workspace, we fall back to a lookup via vrt_priv_dynamic_get().
-
Nils Goroll authored
polishes 06cf60a0 I should have taken more time for that merge.
-
Nils Goroll authored
just to clarify for the next commit.
-
Nils Goroll authored
VRT_priv_task() inserts a priv_task if it does not exist. In some cases, it is more efficient to only insert a priv_task under certain conditions. These require an API function to only return a priv_task if it exists. This is VRT_priv_task_lookup(). A TODO comment has been added for a sensible performance optimization, avoiding one VRBT traversal for the VRT_priv_task() case. I would address this after this suggestion got accepted, if so.
-
Nils Goroll authored
as suggested by Dridi
-
Nils Goroll authored
Originally suggested by @rezan in https://github.com/varnishcache/varnish-cache/pull/3408/commits/4caad2c1858afb399f75230916183d31f57fc908
-
Nils Goroll authored
-
Nils Goroll authored
With the previous commits, as the bereq uses the req workspace, we cannot roll back the req without also rolling back the bereq. As the use case is rather exotic, we spare the additional complications and just outlaw rollbacks from vcl_pipe. std.rollback(bereq) is already forbidden by the compiler because the bereq symbol is not available in vcl_pipe {}. We could, alternative to the runtime failure for std.rollback(req), remove the req symbol from vcl_pipe {}, but that could break use of req to vmod functions also. So we chose the more compatible route of selectively failing rollback rather than making impossible other use cases.
-
Reza Naghibi authored
Also make sure we didn't overflow before entering vcl_pipe. This would mean we have lost important connection headers.
-
Nils Goroll authored
instead of overriding ctx.ws spefically, just let the Req2Ctx settings win This also moves pipe logging to the client side where it belongs.
-
Reza Naghibi authored
Previously bo->ws was used which led to workspace mixing. req->ws safely outlives both the bo and req object when piping.
-
Reza Naghibi authored
-
Nils Goroll authored
fixes a regression introduced by c1352b0b: by not using a suckaddr, VTCP_myname() would also work on UDS, but none of the VTCP was ever intended to (and there are other places where that is asserted). So one could argue that 9837045a was already wrong, but I do not want to deflect from my own mistake in any way. Fixes #3492
-
Dridi Boukelmoune authored
Refs #3134
-
Nils Goroll authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
exercise both IPv4 and IPv6
-
- 10 Jan, 2021 2 commits
-
-
Nils Goroll authored
Coverity CID 1362617, CID 1362625, CID 1362626, CID 1362627
-
Nils Goroll authored
introduced with 1c19f3fe CID 1471724 Ref #3490
-
- 09 Jan, 2021 6 commits
-
-
Nils Goroll authored
Ref #3490
-
Nils Goroll authored
For 127.0.0.1, use "None", "${localhost}" or "${bind_addr}" as appropriate. Instead of ${Xaddr}:${Xport}, use ${Xsock} For some tests, we need to add a Host header to make them stable for differing server addresses. Ref #3490
-
Nils Goroll authored
to support IPv6 only hosts, we try to resolve "localhost" if resolving "127.0.0.1" fails. Whatever address we determine is stored in the ${localhost} macro. Because of the different address:port vs. [address]:port formats for IPv4 vs. IPv6, we store "${localhost}:0" / "[${localhost}]:0" in the ${listen_addr} macro. Likewise we unify the *_sock macros to ${Xaddr}:${Xport} (the colon used to be missing) for IPv4 and [${Xaddr}]:${Xport} for IPv6. We also save ${listen_addr} in default_listen_addr for use from within the vtest code whenever we want to bind to or listen on an emphemeral port. Ref #3490
-
Nils Goroll authored
32 bytes are not enough to hold the colons of a full length IPv6 address.
-
Nils Goroll authored
- write to stderr - output errno for EAI_SYSTEM
-
Nils Goroll authored
for "backend default none;" Ref #3067
-
- 08 Jan, 2021 9 commits
-
-
Poul-Henning Kamp authored
Connection failed (fec0:: 19925): (null) The's not an IPv6 address. *This* is an IPv6 address: fec0::205
-
Nils Goroll authored
Before c1352b0b, the function asserted that getsockname() succeed. We now restore this behaviour in a way which Flexelint understands (we are returning the memory which we allocated).
-
Nils Goroll authored
When we reserve a session attribute, we now check that the reserved space is of the expected size.
-
Nils Goroll authored
-
Nils Goroll authored
-
Nils Goroll authored
avoids an second getsockname() in vbp_write_proxy_v1() avoids a memcpy() in VTCP_my_suckaddr()
-
Dridi Boukelmoune authored
In order to run the test we want to NOT be using gcov, so we should test that the environment variable is empty. In theory that should mean that GCOV runs should currently fail since the feature check is currently backwards so I may revert this change if that suddenly happens. I find `test -z ...` more readable than `[ -z ... ]` in this context, so if it comes to a revert, I will keep the test(1) syntax.
-
Nils Goroll authored
Flexelint on Linux exhibits exactly the problem described by phk in his rant at the top of vsa.c, quote: Do I need to tell you that static code analysis tools have a really hard time coping with (struct suckaddr_storage), and that they give a lot of false negatives which confuse people ? One instance of this issue: --- Module: cache/cache_acceptor.c (C) _ #... _assert(!!((getsockname(sp->fd, (void*)&ss, &sl)) == 0)) /*lint -restore * #... getsockname(sp->fd, (void*)&ss, &sl)) == 0); } while (0) AZ(getsockname(sp->fd, (void*)&ss, &sl)); cache/cache_acceptor.c 330 Error 64: Type mismatch (arg. no. 2) (union __SOCKADDR_ARG = void *) _ #... SA_Build(sa, &ss, sl)) != 0); } while (0) AN(VSA_Build(sa, &ss, sl)); cache/cache_acceptor.c 332 Warning 603: Symbol 'ss' (line 318) not initialized cache/cache_acceptor.c 318 Info 830: Location cited in prior message _ i = accept(ls->sock, (void*)&wa.acceptaddr, cache/cache_acceptor.c 458 Error 64: Type mismatch (arg. no. 2) (union __SOCKADDR_ARG = void *) There is one more in cache/cache_backend_probe.c As the purpose of VSA is to avoid exactly this kind of trouble, we provide a VSA-wrapper for getsockname.
-
Nils Goroll authored
-
- 07 Jan, 2021 2 commits
-
-
Poul-Henning Kamp authored
-
Nils Goroll authored
needed on FreeBSD This reverts commit 19586003.
-