Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Transit buffer #3572

Merged
merged 4 commits into from
Nov 7, 2022
Merged

Conversation

fwsGonzo
Copy link
Contributor

@fwsGonzo fwsGonzo commented Apr 12, 2021

This PR implements the transit buffer feature (previously called pass buffering).

@fwsGonzo fwsGonzo force-pushed the transit_buffering branch 8 times, most recently from 86f384d to 24061de Compare April 12, 2021 09:31
@fwsGonzo
Copy link
Contributor Author

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.

@fwsGonzo
Copy link
Contributor Author

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.

@fwsGonzo fwsGonzo force-pushed the transit_buffering branch 2 times, most recently from fd651bf to b420a0d Compare August 30, 2021 14:31
@dridi dridi force-pushed the transit_buffering branch 2 times, most recently from 8c9d469 to da03c94 Compare December 7, 2021 12:29
@dridi
Copy link
Member

dridi commented Dec 7, 2021

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.

@nigoroll
Copy link
Member

powwow: @nigoroll to propose an implementation without the timeout

@nigoroll nigoroll self-assigned this Dec 13, 2021
@nigoroll
Copy link
Member

FTR, /me feels bad about not having got to this todo item

@nigoroll
Copy link
Member

nigoroll commented Jun 1, 2022

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

@nigoroll
Copy link
Member

nigoroll commented Jun 1, 2022

tests/c00110.vtc (formally tests/c0009.vtc) is not reliable on the rebased but otherwise onmodified a2ca25f

$ ./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...

@fwsGonzo
Copy link
Contributor Author

fwsGonzo commented Jun 1, 2022

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.

@nigoroll
Copy link
Member

nigoroll commented Jun 1, 2022

@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.

@fwsGonzo
Copy link
Contributor Author

fwsGonzo commented Jun 1, 2022

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.

@nigoroll
Copy link
Member

nigoroll commented Jun 1, 2022

@fwsGonzo can we just have the branch for this PR updated without unrelated commits please?

@fwsGonzo
Copy link
Contributor Author

fwsGonzo commented Jun 1, 2022

You can push to it if you want!

This clarifies which length this field is about.

Better diff with the --word-diff --word-diff-regex='\w+' options.

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
It pauses the fetch progress when clients are lagging behind for
uncacheable streaming deliveries.

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
To override the global parameter on a per-fetch basis.

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
@nigoroll
Copy link
Member

nigoroll commented Jun 1, 2022

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 nigoroll@904e419 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.

@anthosz
Copy link

anthosz commented Oct 11, 2022

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 😁

@fwsGonzo
Copy link
Contributor Author

@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
Copy link

anthosz commented Oct 26, 2022

@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 🤔

@nigoroll nigoroll merged commit 530dc80 into varnishcache:master Nov 7, 2022
@nigoroll
Copy link
Member

nigoroll commented Nov 7, 2022

Pushed in the context of this PR: caf49d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants