feature: Transit buffer
This PR implements the transit buffer feature (previously called pass buffering).
Feel free to give some input on what the defaults should be. Zero bytes transit buffer has to be allowed, because that disables the feature.
I rebased against latest and added a commit message. The message is not very long right now so if there's anything you would like me to add there, I will be happy to do that.
I force-pushed a split of the transit buffer patch into 4 commits. Doing so, I tried to polish the commit log, C code and test cases. I couldn't make c112 fail reliably with transit buffer disabled (it passes reliably when enabled) so I didn't keep it.
powwow: @nigoroll to propose an implementation without the timeout
FTR, /me feels bad about not having got to this todo item
rebased onto master here https://github.com/nigoroll/varnish-cache/tree/transit_buffering for the rebase I renamed all test cases by incrementing the test case number by one now working on the proposed change
tests/c00110.vtc (formally tests/c0009.vtc) is not reliable on the rebased but otherwise onmodified a2ca25fc658afe0d6d69d010ff5bfb0b647887a0
$ ./varnishtest -in 1000 -j50 tests/c00110.vtc
...
---- v1 Not true: VBE.vcl1.s1.conn (1) == 0 (0)
@fwsGonzo / @Dridi could you look into this? My plan on this ticket was to implement my proposed change (which I still think should be safe, sound and simple), but this issue seems non trivial and is blocking any other progress...
I am running on an X1 Carbon laptop running the same test with lower parallelism, but I am unable to reproduce. Should add that I am extending varnishtest to support my CMake build system, but other than that everything is the same. I rebased using your transit_buffering branch.
@fwsGonzo For our convenience, would you force-push this branch please?
Regarding the test, there was no CMake/make involved in the test failure, just pure varnishtest.
But I tried to reproduce it again and it seems to go away after a make clean && make. So I guess this was a false alert from my end, sorry.
I pushed my VC working tree here: https://github.com/fwsGonzo/varnish-cache/tree/latest_transit
There are a few scuffed commits in there as I am trying to keep the fuzzing support up to date, but it's getting harder with time.
@fwsGonzo can we just have the branch for this PR updated without unrelated commits please?
You can push to it if you want!
So I would like to propose to remove the timeout while waiting on the condition variable, based on the argument that we do not need it if our code is correct, and if our code is not correct, we should rather fix it than add stop-gaps.
See https://github.com/nigoroll/varnish-cache/commit/904e419a39860d17dd7df79538a96284a5d4f22f from https://github.com/nigoroll/varnish-cache/tree/transit_buffering-notimeout
The only thing that was missing was a wakeup on the condvar for the HSH_Cancel() path.
Dear all,
Do we have an estimation when it will be merged and for which version?
Really interesting feature that can save memory and optimize stability 😁
@anthosz You can probably just build this PR from source and use it as-is. As long as @nigoroll did not break anything with his improvements, it should be fine. This feature has been running in production in the enterprise version of Varnish for a long time now.
@anthosz You can probably just build this PR from source and use it as-is. As long as @nigoroll did not break anything with his improvements, it should be fine. This feature has been running in production in the enterprise version of Varnish for a long time now.
Thank you but it's strange that it's not merged in this case 🤔
Pushed in the context of this PR: caf49d8b42b97c3599e01f2e503d24991a1a0bcf